Skip to content

Commit

Permalink
Use instance's default queue for queued_jobs default (#368)
Browse files Browse the repository at this point in the history
phy1729 authored Dec 14, 2022

Verified

This commit was signed with the committer’s verified signature. The key has expired.
HighCrit HighCrit
1 parent f29a8a7 commit bfa8e68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arq/connections.py
Original file line number Diff line number Diff line change
@@ -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])

0 comments on commit bfa8e68

Please sign in to comment.