cbrain
cbrain copied to clipboard
Add signal handler for INT, TERM and USR1 in AlterTask main loop
That way we can kill the process and get it to finish up the current task before ending the loop early and properly.
Change $0 so it indicates the signal was received, too.
Code is in models/bourreau.rb
Maybe we can do this for other background loops.
Maybe we could use the Worker framework instead, which already has support for that.
Implemented in https://github.com/aces/cbrain/commit/1c156d565c54f3a539a0566993c1f0a12900dd72
(TERM signal only)