From bfa8e68fff7063e792f4a5deef0f778eb549d73c Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Wed, 14 Dec 2022 14:19:32 +0000 Subject: [PATCH] Use instance's default queue for queued_jobs default (#368) --- arq/connections.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arq/connections.py b/arq/connections.py index 76d8ded3..d4fc4434 100644 --- a/arq/connections.py +++ b/arq/connections.py @@ -195,10 +195,12 @@ async def _get_job_def(self, job_id: bytes, score: int) -> JobDef: jd.score = score return jd - async def queued_jobs(self, *, queue_name: str = default_queue_name) -> List[JobDef]: + async def queued_jobs(self, *, queue_name: Optional[str] = None) -> List[JobDef]: """ Get information about queued, mostly useful when testing. """ + if queue_name is None: + queue_name = self.default_queue_name jobs = await self.zrange(queue_name, withscores=True, start=0, end=-1) return await asyncio.gather(*[self._get_job_def(job_id, int(score)) for job_id, score in jobs])