From 3cd53b3dd99ba30054a5c2534f2f583840041538 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 31 May 2023 18:09:56 -0400 Subject: [PATCH] Fixed router --- cmd/router/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/router/main.go b/cmd/router/main.go index 34d73c5..37e041d 100644 --- a/cmd/router/main.go +++ b/cmd/router/main.go @@ -76,16 +76,16 @@ func main () { } // be a daemon - daemon.ShutdownOnSigint() + daemon.ShutdownOnSigint(&manager) pidfile := daemon.PidFile(os.Getenv("HNAKRA_PIDFILE")) if !pidfile.Empty() { err := pidfile.Start() if err != nil { log.Println("!!! could not write pid:", err) } + defer func () { + err := pidfile.Close() + if err != nil { log.Println("!!! could not delete pidfile:", err) } + } () } - defer func () { - err := pidfile.Close() - if err != nil { log.Println("!!! could not delete pidfile:", err) } - } () // run servers err = manager.Run()