Add a setting for when to stop the scheduler.
jksy opened this issue · comments
Hello, Thank you for making great software.
Currently, when sidekiq is stopped by TSTP, new jobs are not enqueued by sidekiq-scheduler.
I want the scheduler to enqueue even after Sidekiq receives a TSTP signal.
For example, we want to stop a job during server maintenance, but we want the enqueue itself to run.
I found the Issue. The Issue and Pull Request fixed sidekiq-scheduler stops when it receives the quiet event.
#264
I want the scheduler to stop when it receives the :shutdown signal.
Therefore, it would be great if the stop timing can be set as :quiet or :shutdown in the configuration file.
I would like you to create a Pull Request or tell me if you have another solution.
@jksy Feel free to send a PR. The default should stay the same and the possibility is to switch the shutdown
signal.
I also would suggest adding to the README an explanation what is the difference between both (or point to sidekiq docs); I believe there's some kind of risk in letting the scheduler enqueue jobs after the quiet
signal.
@marcelolx
Thanks a lot for your reply.
I actually wrote the code and tried it, but you are right, I could not enqueue it successfully after receiving the TSTP
signal.
I read the README and it already mentioned that. (Wish I had noticed that earlier)
https://github.com/moove-it/sidekiq-scheduler#notes-on-when-sidekiq-worker-is-down
It seems difficult for me to solve this problem and I will try to find another solution.