fix: Don't init site if already init-ed during truncate (#25033)

This commit is contained in:
Ankush Menat 2024-02-23 17:07:38 +05:30 committed by GitHub
parent 0b3061e904
commit a19fd6a8b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -568,7 +568,7 @@ def truncate_failed_registry(job, connection, type, value, traceback):
"""Ensures that number of failed jobs don't exceed specified limits."""
from frappe.utils import create_batch
conf = frappe.get_conf(site=job.kwargs.get("site"))
conf = frappe.conf if frappe.conf else frappe.get_conf(site=job.kwargs.get("site"))
limit = (conf.get("rq_failed_jobs_limit") or RQ_FAILED_JOBS_LIMIT) - 1
for queue in get_queues(connection=connection):