traefik/server/server_signals_windows.go
2017-08-11 12:04:58 +02:00

26 lines
416 B
Go

// +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()
}
}
}