Fixed router

This commit is contained in:
Sasha Koshka 2023-05-31 18:09:56 -04:00
parent 8a528e2b4e
commit 3cd53b3dd9

View File

@ -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()