mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
Enable back door for clearing user's rate-limit history.
(This is helpful to make the tests run faster.) (imported from commit 48c1beaed8cca76976bd6f54224c33460b55ceac)
This commit is contained in:
@@ -54,6 +54,14 @@ def unblock_user(user, domain='all'):
|
||||
_, _, blocking_key = redis_key(user, domain)
|
||||
client.delete(blocking_key)
|
||||
|
||||
def clear_user_history(user, domain='all'):
|
||||
'''
|
||||
This is only used by test code now, where it's very helpful in
|
||||
allowing us to run tests quickly, by giving a user a clean slate.
|
||||
'''
|
||||
for key in redis_key(user, domain):
|
||||
client.delete(key)
|
||||
|
||||
def _get_api_calls_left(user, domain, range_seconds, max_calls):
|
||||
list_key, set_key, _ = redis_key(user, domain)
|
||||
# Count the number of values in our sorted set
|
||||
|
||||
Reference in New Issue
Block a user