chore: refactor for rq 2.x (#30935)

There's no `Connection` anymore - we need to explicitly pass it in everywhere

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2025-01-30 10:33:17 +05:30 committed by GitHub
commit 0612c011dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,6 @@
from collections import defaultdict
from rq import Connection, Worker
from rq import Worker
import frappe.utils
from frappe.utils.background_jobs import get_queue, get_queue_list, get_redis_conn
@ -8,8 +8,7 @@ from frappe.utils.scheduler import is_scheduler_disabled, is_scheduler_inactive
def get_workers():
with Connection(get_redis_conn()):
return Worker.all()
return Worker.all(connection=get_redis_conn())
def purge_pending_jobs(event=None, site=None, queue=None):