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

Making job check interval a function of job type #5

Closed
jtlapp opened this issue Jul 24, 2016 · 6 comments
Closed

Making job check interval a function of job type #5

jtlapp opened this issue Jul 24, 2016 · 6 comments

Comments

@jtlapp
Copy link

jtlapp commented Jul 24, 2016

newJobCheckInterval is configured for all of pg-boss, but different job types can have different interval requirements. Consider the following job types:

  • send health check to cluster node (might be every 10 minutes)
  • download an mp3 from a web site (might be once per minute)
  • delete a file (might be once per 100ms -- might be queued because many files)

It would be nice to not only configure this as a function of job type, but to be able to dynamically change it as a function of job type, in order to support throttling (see #4).

@jtlapp
Copy link
Author

jtlapp commented Jul 24, 2016

But I don't really know how people use this polling interval in practice. You've also got a delay time, which is functionally different but still related. How is a single polling interval selected for many different job types? Seems like it would have to be chosen independently of the jobs performed.

@jtlapp
Copy link
Author

jtlapp commented Jul 24, 2016

There seems to be a workaround for this: create a different instance of pg-boss for each type of job.

@timgit
Copy link
Owner

timgit commented Jul 26, 2016

newJobCheckInterval is an internal configuration setting that I'm being polite to expose for the sake of giving consumers more knobs and buttons to adjust. You won't likely need to change it.

@timgit
Copy link
Owner

timgit commented Jul 26, 2016

you shouldn't need to create multiple pg-boss instances for that.

At this point, I think you'd be better off just throwing your application together using a single instance with multiple publish and subscribes of all of your job types.

@jtlapp
Copy link
Author

jtlapp commented Jul 26, 2016

Closing until I've made a better study of the code. Thanks for your help!

@Globik
Copy link

Globik commented Aug 24, 2018

newJobCheckInterval 's default value is 1 second. But 1 day is also ok.

timgit added a commit that referenced this issue Jun 22, 2022
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

3 participants