Perform graceful shutdown of the runner on SIGINT/SIGTERM
darthhexx opened this issue · comments
To ensure we don't leave things half done, we need to catch the signal, set a variable and then check it in our main loop for the exit condition.
I looked at this, and as I recall, Go passed the signal down to any child processes even when it was caught. This meant that even if the runner caught the signal, any running WP-CLI process responded to the signal.
I added the option to disable execution to deal with this situation. It's a per-site option, but if one needed to shutdown all execution, one could filter the a8c_cron_control_disable_run
option to return 1
:
Cron-Control/includes/class-events.php
Line 23 in 61dc3f4