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
|
return
|
||||||
end
|
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)
|
$redis.del redis_key(user_agent, date)
|
||||||
end
|
end
|
||||||
|
|
||||||
$redis.del(list_key)
|
$redis.del(ua_list_key)
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
Loading…
Reference in New Issue