WebCrawlerRequest.clear_cache needs to clear user agent list too
This commit is contained in:
parent
7311023a52
commit
2bd44bbf13
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue