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

Worker automatically cleans job registries every hour #534

Merged
merged 3 commits into from
May 28, 2015

Conversation

selwin
Copy link
Collaborator

@selwin selwin commented May 23, 2015

Version 0.5.0 introduced StartedJobRegistry and FinishedJobRegistry. Unmaintained, job registries could grow to really large sizes. This is reported by @cosminstefanxp in #519 .

This PR introduces a feature where workers will clean up job registries every hour without having to run out of band maintenance scripts, simplifying worker deployments.

If there's no complaints, I'll merge this in a few days.

Fixes #519.

@cosminstefanxp
Copy link
Contributor

It looks really good. Thanks for this. I'd suggest though that you add a way of specifying the cleanup time. Something like a property of the Worker that can either be changed when extending the class or set at creation.

@selwin
Copy link
Collaborator Author

selwin commented May 23, 2015

I agree, I also thought about adding a user configurable "maintenance_interval" argument that can be specified during Worker.init() . That can be added in a later pull request.

Sent from my phone

On May 23, 2015, at 7:14 PM, Cosmin Stefan-Dobrin notifications@github.com wrote:

It looks really good. Thanks for this. I'd suggest though that you add a way of specifying the cleanup time. Something like a property of the Worker that can either be changed when extending the class or set at creation.


Reply to this email directly or view it on GitHub.

selwin added a commit that referenced this pull request May 28, 2015
Worker automatically cleans job registries every hour
@selwin selwin merged commit f370f79 into rq:master May 28, 2015
@selwin selwin deleted the registry-maintenance branch May 28, 2015 00:44
@nvie
Copy link
Collaborator

nvie commented Jun 3, 2015

Thanks, @selwin, this is very well done! I've renamed the maintenance_date to last_cleaned_at, to reflect the nature of the state value a bit more accurately (see ec0e047).

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 this pull request may close these issues.

The finished jobs list (rq:finished:) never gets cleaned up
3 participants