mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Prevent topic_retriever from retrieving more than once a minute
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user