lib/wmap/site_tracker.rb
# 'Refresh sites in the site store in batch (from a list)
'Refresh sites in the site store in batch (from a list)
' Refresh sites in the site store in batch ( from a list )
def bulk_refresh(list,num=@max_parallel)
		puts "Refresh entries in the site store from list:\n #{list}" if @verbose
		results=Hash.new
		if list.size > 0
			puts "Start parallel refreshing on the sites:\n #{list}"
			Parallel.map(list, :in_processes => num) { |target|
				refresh(target)
			}.each do |process|
				if process.nil?
					next
				elsif process.empty?
				else
					results[process['url']]=Hash.new
					results[process['url']]=process
				end
			end
			list.map {|x| @known_sites.delete(x)}
			@known_sites.merge!(results)
			puts "Done refresh sites."
		else
			puts "Error: no entry is loaded. Please check your list and try again."
		end
		return results
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
	end
def bulk_refresh ( list , num = @max_parallel ) puts "Refresh entries in the site store from list:\n #{list}" if @verbose results = Hash . new if list . size > 0 puts "Start parallel refreshing on the sites:\n #{list}" Parallel . map ( list , :in_processes => num ) { | target | refresh ( target ) } . each do | process | if process . nil? next elsif process . empty? else results [ process [ 'url' ] ] = Hash . new results [ process [ 'url' ] ] = process end end list . map { | x | @known_sites . delete ( x ) } @known_sites . merge! ( results ) puts "Done refresh sites." else puts "Error: no entry is loaded. Please check your list and try again." end return results rescue => ee puts "Exception on method #{__method__}: #{ee}" if @verbose end
'Refresh sites in the site store in batch (from a list)
' Refresh sites in the site store in batch ( from a list )
#do nothing # Clean up old entries, by Y.L. 03/30/2015 # Add back fresh entries
list
<not_specific>
num
<not_specific>