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

How to get jobs in order to abort #376

Closed
dokime7 opened this issue Dec 15, 2022 · 4 comments · Fixed by #378
Closed

How to get jobs in order to abort #376

dokime7 opened this issue Dec 15, 2022 · 4 comments · Fixed by #378

Comments

@dokime7
Copy link

dokime7 commented Dec 15, 2022

Hi and thanks for this work!

In order to abort some deferred jobs, I need to get an instance of arq.jobs.Job but I don't find how to get jobs.
I'm using FastAPI with an endpoint to enqueue job and another to abort job, so I don't have the job instance returns by enqueue_job().

How can I do that?

Thanks

@JonasKs
Copy link
Sponsor Collaborator

JonasKs commented Dec 15, 2022

Hi, please see #372 (comment).

@dokime7
Copy link
Author

dokime7 commented Dec 15, 2022

Thanks, it could be help, but I can't always save the job id.

I've seen that queued_jobs() can return a list of JobDef, so I can retrieve a JobDef by matching an external id on kwargs but JobDef doesn't return job id...

@JonasKs
Copy link
Sponsor Collaborator

JonasKs commented Dec 15, 2022

Aha, I can fix that.

@dokime7
Copy link
Author

dokime7 commented Dec 15, 2022

It would be great 👍🏼 👌🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants