Fix SIGINT handling

Go's not very helpful here.
This commit is contained in:
Simon Ser 2021-02-17 18:37:30 +01:00
parent 373453ff23
commit f7fc805026
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 3 additions and 3 deletions

View File

@ -72,12 +72,12 @@ func main() {
for sig := range sigCh {
switch sig {
case syscall.SIGINT:
case syscall.SIGTERM:
case syscall.SIGINT, syscall.SIGTERM:
log.Print("stopping server")
srv.Stop()
return
case syscall.SIGHUP:
log.Print("caught SIGHUP, reloading config")
log.Print("reloading config")
newSrv, err := newServer()
if err != nil {
log.Printf("reload failed: %v", err)