I noticed when hitting CTRL+C when TeleIRC was running, the bot didn't exit gracefully, it exited with EXITCODE 2.
This pull captures the SIGTERM signal when CTRL+C is hit (or when something sends SIGTERM to the process), and then has the program gracefully exit. First, however, it will send the IRC QUIT message if it is specified in the config.
...
I didn't add unit tests to irc.go for the new function, I'm not experienced in go to figure out how to mock a third-party library. But the function is simple enough where I'm not super concerned.
I noticed when hitting CTRL+C when TeleIRC was running, the bot didn't exit gracefully, it exited with EXITCODE 2.
This pull captures the SIGTERM signal when CTRL+C is hit (or when something sends SIGTERM to the process), and then has the program gracefully exit. First, however, it will send the IRC QUIT message if it is specified in the config.
...
I didn't add unit tests to irc.go for the new function, I'm not experienced in go to figure out how to mock a third-party library. But the function is simple enough where I'm not super concerned.