django-rq icon indicating copy to clipboard operation
django-rq copied to clipboard

admin interface to clear failed jobs?

Open ccurvey opened this issue 3 years ago • 5 comments

Am I missing something?

I have some queues with lots of very old failed jobs. I'd like to clean things up, but the only "bulk" options I have are to clear the entire queue (which would include queued jobs as well), or "requeue" jobs, which I also don't want to do.

I guess I could go through and delete from the failed list 50 jobs at a time, but that seems to be a lot of pointing and clicking.

(hmm, maybe this was added to 2.4? I'm still on 2.3.2...)

ccurvey avatar Jan 26 '21 11:01 ccurvey

Yeah @ccurvey I see this as well. I too have to delete jobs in batches 😆

spetoolio avatar Jan 27 '21 17:01 spetoolio

I had this exact problem so I created a Django management command to do bulk deletions of failed jobs. The code gist is here.

jbarham avatar Feb 03 '21 08:02 jbarham

Hm, perhaps I am missing something but when I go to /django-rq as a superuser I can delete jobs. I am using Django, Django Rest Framework, and Django admin

majonathany avatar Mar 10 '21 17:03 majonathany

Sure you can delete 50 jobs at a time from the web UI. But if you have hundreds or thousands of failed jobs to delete that becomes very tedious.

jbarham avatar Mar 11 '21 20:03 jbarham

Ideally, there's also an option to delete all and not just the 50 selected jobs from the queue, similar to how Django's admin behaves. I'd be happy to accept a PR for this.

CleanShot 2021-03-31 at 08 02 08@2x

selwin avatar Mar 31 '21 01:03 selwin