Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use instance's default queue for queued_jobs default #368

Merged
merged 1 commit into from
Dec 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion arq/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
JonasKs marked this conversation as resolved.
Show resolved Hide resolved
"""
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])

Expand Down