internal/router: only do cleanup in cd mode on freebsd

This commit is contained in:
Cuong Manh Le
2023-07-28 18:57:13 +00:00
committed by Cuong Manh Le
parent c271896551
commit 774f07dd7f
2 changed files with 16 additions and 4 deletions
+2 -2
View File
@@ -283,13 +283,13 @@ func initCLI() {
rootCertPool = cp
}
p.onStarted = append(p.onStarted, func() {
mainLog.Load().Debug().Msg("router setup")
mainLog.Load().Debug().Msg("router setup on start")
if err := p.router.Setup(); err != nil {
mainLog.Load().Error().Err(err).Msg("could not configure router")
}
})
p.onStopped = append(p.onStopped, func() {
mainLog.Load().Debug().Msg("router cleanup")
mainLog.Load().Debug().Msg("router cleanup on stop")
if err := p.router.Cleanup(); err != nil {
mainLog.Load().Error().Err(err).Msg("could not cleanup router")
}