From 8db2e1e2a6cf00c905ebd5b2b2049afa66dfbe7e Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 24 Dec 2024 15:11:18 +0530 Subject: [PATCH] fix: Avoid applying pinning optimization on RQ (#28896) We only need it for gunicorn workers. --- frappe/_optimizations.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frappe/_optimizations.py b/frappe/_optimizations.py index 226f185c0e..439d055244 100644 --- a/frappe/_optimizations.py +++ b/frappe/_optimizations.py @@ -97,6 +97,9 @@ def optimize_for_gil_contention(): if not os.environ.get("FRAPPE_PERF_PIN_WORKERS"): return + if "gunicorn" not in str(sys.argv[0]): + return + if os.environ.get("FRAPPE_PERF_PIN_WORKERS_DETERMINISTIC"): # Ensure same pinning order every time. # This is only useful for benchmarking, DO NOT enable this in production.