mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: application request count keys not expiring in redis
This commit is contained in:
parent
2bd44bbf13
commit
eb714d8ae3
@ -50,7 +50,9 @@ module CachedCounting
|
|||||||
# for concurrent calls without double counting
|
# for concurrent calls without double counting
|
||||||
def get_and_reset(key)
|
def get_and_reset(key)
|
||||||
namespaced_key = $redis.namespace_key(key)
|
namespaced_key = $redis.namespace_key(key)
|
||||||
$redis.without_namespace.eval(GET_AND_RESET, keys: [namespaced_key]).to_i
|
val = $redis.without_namespace.eval(GET_AND_RESET, keys: [namespaced_key]).to_i
|
||||||
|
$redis.expire(key, 259200) # SET removes expiry, so set it again
|
||||||
|
val
|
||||||
end
|
end
|
||||||
|
|
||||||
def request_id(query_params, retries = 0)
|
def request_id(query_params, retries = 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user