From 67e20416912bb0b7849be8c5fc4efc111530545f Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 16 Nov 2016 12:04:16 -0500 Subject: [PATCH] Prevent topic_retriever from retrieving more than once a minute --- lib/topic_retriever.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/topic_retriever.rb b/lib/topic_retriever.rb index fecccb65728..7401619c36f 100644 --- a/lib/topic_retriever.rb +++ b/lib/topic_retriever.rb @@ -21,7 +21,7 @@ class TopicRetriever return false if @opts[:no_throttle] # Throttle other users to once every 60 seconds - retrieved_key = "retrieved:#{@embed_url}" + retrieved_key = "retrieved_topic" if $redis.setnx(retrieved_key, "1") $redis.expire(retrieved_key, 60) return false