lib/wmap/site_tracker.rb
# Setter to add site entry to the cache in batch (from a list)
Setter to add site entry to the cache in batch (from a list)
Setter to add site entry to the cache in batch ( from a list )
def bulk_add(list,num=@max_parallel)
		puts "Add entries to the local site store from list:\n #{list}"
		results=Hash.new
		list = list - [nil,""]
		if list.size > 0
			puts "Start parallel adding on the sites:\n #{list}"
			Parallel.map(list, :in_processes => num) { |target|
				add(target)
			}.each do |process|
				if process.nil?
					next
				elsif process.empty?
					next 
				else
					results[process['url']]=Hash.new
					results[process['url']]=process
				end
			end
			@known_sites.merge!(results)
		else
			puts "Error: no entry is added. Please check your list and try again."
		end
		puts "Done adding site entries."
		if results.size>0
			puts "New entries added: #{results}"
		else
			puts "No new entry added. "
		end
		return results
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
	end
def bulk_add ( list , num = @max_parallel ) puts "Add entries to the local site store from list:\n #{list}" results = Hash . new list = list - [ nil , "" ] if list . size > 0 puts "Start parallel adding on the sites:\n #{list}" Parallel . map ( list , :in_processes => num ) { | target | add ( target ) } . each do | process | if process . nil? next elsif process . empty? next else results [ process [ 'url' ] ] = Hash . new results [ process [ 'url' ] ] = process end end @known_sites . merge! ( results ) else puts "Error: no entry is added. Please check your list and try again." end puts "Done adding site entries." if results . size > 0 puts "New entries added: #{results}" else puts "No new entry added. " end return results rescue => ee puts "Exception on method #{__method__}: #{ee}" if @verbose end
Setter to add site entry to the cache in batch (from a list)
Setter to add site entry to the cache in batch ( from a list )
#do nothing
list
<not_specific>
num
<not_specific>