mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05: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]
|
||||
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user