traefik/server/server_signals_windows.go

27 lines
416 B
Go
Raw Normal View History

// +build windows
package server
import (
"os/signal"
"syscall"
"github.com/containous/traefik/log"
)
func (server *Server) configureSignals() {
signal.Notify(server.signals, syscall.SIGINT, syscall.SIGTERM)
}
func (server *Server) listenSignals() {
for {
sig := <-server.signals
switch sig {
default:
log.Infof("I have to go... %+v", sig)
log.Info("Stopping server")
server.Stop()
}
}
}