WebCrawlerRequest.clear_cache needs to clear user agent list too

This commit is contained in:
Neil Lalonde 2018-03-27 15:11:48 -04:00
parent 7311023a52
commit 2bd44bbf13

View File

@ -51,13 +51,13 @@ class WebCrawlerRequest < ActiveRecord::Base
return
end
list_key = user_agent_list_key(date)
ua_list_key = user_agent_list_key(date)
$redis.smembers(list_key).each do |user_agent, _|
while user_agent = $redis.spop(ua_list_key)
$redis.del redis_key(user_agent, date)
end
$redis.del(list_key)
$redis.del(ua_list_key)
end
protected