// create a signal handler and a channel which we will notify
// upon receiving a SIGINT, SIGTERM or interrupt
create a signal handler and a channel which we will notify
upon receiving a SIGINT, SIGTERM or interrupt
// create a signal handler and a channel which we will notify // upon receiving a SIGINT SIGTERM or interrupt
func createShutdownHook(shutdown ShutdownHookFunc) chan bool {
	done := make(chan bool)
	c := make(chan os.Signal, 1)
	signal.Notify(c, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
	go func() {
		s := <-c
		log.Infof("%v signal received, shutting down...", s)
		shutdown()
		done <- true
	}()
	return done
}
func createShutdownHook ( shutdown ShutdownHookFunc ) chan bool { done := make ( chan bool ) c := make ( chan os . Signal , 1 ) signal . Notify ( c , os . Interrupt , syscall . SIGINT , syscall . SIGTERM ) go func ( ) { s := <- c log . Infof ( " " , s ) shutdown ( ) done <- true } ( ) return done }
create a signal handler and a channel which we will notify
upon receiving a SIGINT, SIGTERM or interrupt
create a signal handler and a channel which we will notify upon receiving a SIGINT SIGTERM or interrupt