fix: allow multiple @rate_limit decorators to be considered (#31209)
This commit is contained in:
parent
ef3b0ef008
commit
f040fb446c
1 changed files with 3 additions and 0 deletions
|
|
@ -153,6 +153,9 @@ def rate_limit(
|
|||
|
||||
cache_key = frappe.cache.make_key(f"rl:{frappe.form_dict.cmd}:{identity}")
|
||||
|
||||
if not callable(seconds):
|
||||
cache_key += f":{seconds}".encode()
|
||||
|
||||
value = frappe.cache.get(cache_key)
|
||||
if not value:
|
||||
frappe.cache.setex(cache_key, seconds, 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue