From 2bd44bbf1368ac920d69701636fcaa5f9498dbc4 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 27 Mar 2018 15:11:48 -0400 Subject: [PATCH] WebCrawlerRequest.clear_cache needs to clear user agent list too --- app/models/web_crawler_request.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/web_crawler_request.rb b/app/models/web_crawler_request.rb index 5e418d1b1c1..edcad4c9ad3 100644 --- a/app/models/web_crawler_request.rb +++ b/app/models/web_crawler_request.rb @@ -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