-
Notifications
You must be signed in to change notification settings - Fork 867
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
Add improvements to run kue from a worker process #579
Conversation
…to wait for interval if there are already jobs to promote on start. Automattic#574
shutdown should close the process when |
If you look at the worker examples, disableSearch is true, but doesn't close the process, and anyway it should be true by default as far as I understand... I guess this is still a work in progress on your side, since it is unrelated to the code I added. |
I remember we had a similiar bug which had been fixed, but when search indexes are enabled, the Would you break down this PR into two:
|
The PR I sent is exactly your point 1) Regarding 2) I'm not sure how to create that test case. It seems that the redis client is ended, but the process doesn't exit |
queue.on('job complete', function(result) { | ||
console.log('Job completed with result', result); | ||
closeIfCan(); | ||
}).on('promotion:end', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot depend on promotion:end
being called in every node in a clustered deployment.
Should we add a mock promotion:end
event to all nodes that are silent (losers to lock race)? or re-view the whole stuff again?
I had to go ahead with another alternative, and I couldn't have a deep look on how this really works. So yeah feel free to close this PR and review the whole stuff again |
then closing this for now :) |
See issue #574 for more details.
The shutdown doesn't close the process, but it is unrelated to the feature added. I know it is still work in progress so I guess it will be fixed by the time it is released.