fix: use site_cache as clear_cache is broken for redis_cache

This commit is contained in:
Saqib Ansari 2026-04-19 18:49:31 +05:30
parent d618a88f01
commit 65965b9c44

View file

@ -23,13 +23,13 @@ from functools import wraps
import frappe
from frappe.exceptions import ServiceUnavailableError
from frappe.utils import cint
from frappe.utils.caching import redis_cache
from frappe.utils.caching import site_cache
# Default wait timeout (seconds) before returning 503 to the caller.
_DEFAULT_WAIT_TIMEOUT = 10
@redis_cache(shared=True)
@site_cache(ttl=3600)
def _default_limit() -> int:
"""Derive a sensible default concurrency limit from gunicorn's max concurrency."""
return max(1, gunicorn_max_concurrency() // 2)