Catch SIGTERM, only show CTRL+C in development mode

This commit is contained in:
2023-12-24 23:41:23 -06:00
parent 96efd4bdf2
commit 707acc99e2
+6 -1
View File
@@ -8,6 +8,7 @@ import (
"net/http/cookiejar"
"os"
"os/signal"
"syscall"
"time"
"github.com/bwmarrin/discordgo"
@@ -208,7 +209,11 @@ func main() {
stop := make(chan os.Signal, 1)
signal.Notify(stop, os.Interrupt)
log.Info().Msg("Press Ctrl+C to exit")
signal.Notify(stop, syscall.SIGTERM)
if isDevelopment {
log.Info().Msg("Press Ctrl+C to exit")
}
<-stop
log.Warn().Msg("Gracefully shutting down")