fix: allow multiple @rate_limit decorators to be considered (#31209)

This commit is contained in:
s-aga-r 2025-02-11 15:09:34 +05:30 committed by GitHub
parent ef3b0ef008
commit f040fb446c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)