Prevent topic_retriever from retrieving more than once a minute
This commit is contained in:
parent
036954d5b4
commit
67e2041691
|
@ -21,7 +21,7 @@ class TopicRetriever
|
||||||
return false if @opts[:no_throttle]
|
return false if @opts[:no_throttle]
|
||||||
|
|
||||||
# Throttle other users to once every 60 seconds
|
# Throttle other users to once every 60 seconds
|
||||||
retrieved_key = "retrieved:#{@embed_url}"
|
retrieved_key = "retrieved_topic"
|
||||||
if $redis.setnx(retrieved_key, "1")
|
if $redis.setnx(retrieved_key, "1")
|
||||||
$redis.expire(retrieved_key, 60)
|
$redis.expire(retrieved_key, 60)
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue