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

Purge old failed jobs #278

Open
NathanBaulch opened this issue Aug 9, 2018 · 1 comment
Open

Purge old failed jobs #278

NathanBaulch opened this issue Aug 9, 2018 · 1 comment

Comments

@NathanBaulch
Copy link

I've been using Qless in production for over 3 years and have accumulated over 500,000 failed jobs. Is there a "right" way to purge failures older than n days or do I have to roll my sleeves up and write a redis-cli script?

@dlecocq
Copy link
Contributor

dlecocq commented Aug 9, 2018

The best way is probably to call client.jobs.failed() to get all the failure groups, and then you can use client.jobs.failed(group, offset, count) to get all the associated jobs and then for each job you can make a decision to keep or cancel it.

At least, that's how we've scripted it up in the past.

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

No branches or pull requests

2 participants