parent
373453ff23
commit
f7fc805026
|
@ -72,12 +72,12 @@ func main() {
|
||||||
|
|
||||||
for sig := range sigCh {
|
for sig := range sigCh {
|
||||||
switch sig {
|
switch sig {
|
||||||
case syscall.SIGINT:
|
case syscall.SIGINT, syscall.SIGTERM:
|
||||||
case syscall.SIGTERM:
|
log.Print("stopping server")
|
||||||
srv.Stop()
|
srv.Stop()
|
||||||
return
|
return
|
||||||
case syscall.SIGHUP:
|
case syscall.SIGHUP:
|
||||||
log.Print("caught SIGHUP, reloading config")
|
log.Print("reloading config")
|
||||||
newSrv, err := newServer()
|
newSrv, err := newServer()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("reload failed: %v", err)
|
log.Printf("reload failed: %v", err)
|
||||||
|
|
Loading…
Reference in New Issue