lib/wmap/domain_tracker.rb
# 'setter' to add domain entry to the cache in batch (from a list)
'setter' to add domain entry to the cache in batch (from a list)
' setter ' to add domain entry to the cache in batch ( from a list )
def bulk_add(list, num=@max_parallel)
		puts "Add entries to the local domains cache table from list: #{list}" if @verbose
		results=Hash.new
		domains=list
		if domains.size > 0
			Parallel.map(list, :in_processes => num) { |target|
				add(target)
			}.each do |process|
				if process.nil?
					next
				elsif process.empty?
				else
					results.merge!(process)
				end
			end
			@known_internet_domains.merge!(results)
			puts "Done loading domain entries."
			return results
		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_add ( list , num = @max_parallel ) puts "Add entries to the local domains cache table from list: #{list}" if @verbose results = Hash . new domains = list if domains . size > 0 Parallel . map ( list , :in_processes => num ) { | target | add ( target ) } . each do | process | if process . nil? next elsif process . empty? else results . merge! ( process ) end end @known_internet_domains . merge! ( results ) puts "Done loading domain entries." return results 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
'setter' to add domain entry to the cache in batch (from a list)
' setter ' to add domain entry to the cache in batch ( from a list )
#do nothing
list
<not_specific>
num
<not_specific>