-
Notifications
You must be signed in to change notification settings - Fork 793
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
Multi-server lock on jobs #12
Comments
Currently, the way I am handling this is with cluster.isMaster(); basically: if(cluster.isMaster()) {
require('./lib/jobs');
} I agree that ultimately we want to make sure that multiple nodes can process from the same database. This is a temporary workaround until we figure out something better. Any ideas on how we should implement this @sansmischevia ? |
Hi! |
I agree for the most part - specifically find and modify. I don't know if we need I think, then, that perhaps defining the lock timeout on the agenda instead of per job would be better. Otherwise we would have to query for a bunch of different locked times, which woulds result in |
Ok. I will try to implement it via |
Implemented in 0.5.0 |
Awesome, thanks @bars3s and @rschmukler! Now to re-write a ton of code with this new addition... agenda had a showstopper due to multi-server issues, but now it's a real lib that rivals quartznet.sourceforge.net |
Co-authored-by: Aras Abbasi <a.abbasi@cognigy.com>
Having agenda be aware of other nodes in the system that connect to the jobs database will be helpful in the scenario you don't want a dedicated batch machine in your environment. This will prevent the same jobs being run twice in the same environment on different machines. (some sort of distributed lock mechanism with mongo?).
The text was updated successfully, but these errors were encountered: