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

Allow maximum number of workers to be configured per job type. #7

Merged
merged 1 commit into from
Jan 12, 2018

Conversation

jeremywadsack
Copy link
Member

Addresses #3.

We have instances where we would like to have the maximum number of workers depend on the type of Resque Job. For example, we have remote instances that are spun up by a worker, do some work, and then terminate. We could scale this as much as we wanted. In the same project we have workers that are pulling data into the database and we want to limit the number of those so that we aren't overburdening the database server.

This modifies the Job module to include a max_workers method (that becomes a class method for the resque job class that it's extended into). By default this returns the globally set maximum, but can be overridden to define a different value for each class.

@jasonk357 jasonk357 merged commit e9944ce into master Jan 12, 2018
@jeremywadsack jeremywadsack deleted the max-workers-per-job branch January 12, 2018 18:13
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.

None yet

2 participants