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