mirror of
https://github.com/Xevion/banner.git
synced 2026-01-31 02:23:34 -06:00
Catch SIGTERM, only show CTRL+C in development mode
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
"net/http/cookiejar"
|
"net/http/cookiejar"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/bwmarrin/discordgo"
|
"github.com/bwmarrin/discordgo"
|
||||||
@@ -208,7 +209,11 @@ func main() {
|
|||||||
|
|
||||||
stop := make(chan os.Signal, 1)
|
stop := make(chan os.Signal, 1)
|
||||||
signal.Notify(stop, os.Interrupt)
|
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
|
<-stop
|
||||||
|
|
||||||
log.Warn().Msg("Gracefully shutting down")
|
log.Warn().Msg("Gracefully shutting down")
|
||||||
|
|||||||
Reference in New Issue
Block a user