mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-04 20:03:04 +02:00
fix stopsignal for go program.
This commit is contained in:
parent
6ee8bb86fe
commit
b7950b3650
3 changed files with 6 additions and 2 deletions
|
@ -174,11 +174,11 @@ func (neko *Neko) ServeCommand(cmd *cobra.Command, args []string) {
|
|||
neko.Start()
|
||||
neko.logger.Info().Msg("neko ready")
|
||||
|
||||
quit := make(chan os.Signal)
|
||||
quit := make(chan os.Signal, 1)
|
||||
signal.Notify(quit, os.Interrupt)
|
||||
sig := <-quit
|
||||
|
||||
neko.logger.Warn().Msgf("received %s, attempting graceful shutdown: \n", sig)
|
||||
neko.logger.Warn().Msgf("received %s, attempting graceful shutdown", sig)
|
||||
neko.Shutdown()
|
||||
neko.logger.Info().Msg("shutdown complete")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue