Use context in Server
This commit is contained in:
parent
526a04d4c8
commit
f99363674b
5 changed files with 47 additions and 36 deletions
|
@ -2,25 +2,6 @@
|
|||
|
||||
package server
|
||||
|
||||
import (
|
||||
"os/signal"
|
||||
"syscall"
|
||||
func (s *Server) configureSignals() {}
|
||||
|
||||
"github.com/containous/traefik/log"
|
||||
)
|
||||
|
||||
func (s *Server) configureSignals() {
|
||||
signal.Notify(s.signals, syscall.SIGINT, syscall.SIGTERM)
|
||||
}
|
||||
|
||||
func (s *Server) listenSignals() {
|
||||
for {
|
||||
sig := <-s.signals
|
||||
switch sig {
|
||||
default:
|
||||
log.Infof("I have to go... %+v", sig)
|
||||
log.Info("Stopping server")
|
||||
s.Stop()
|
||||
}
|
||||
}
|
||||
}
|
||||
func (s *Server) listenSignals() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue