Remove more os.Exit calls and give a more reliable wait for stop function

This commit is contained in:
Nate Brown authored and JackDoan committed 2026-01-28 12:59:09 -06:00
1 parent 42bee7cf17
commit 6f022a2fff
6 files changed
+109 -32

No files matched your search

+10 -2
View File
@@ -78,8 +78,16 @@ func main() {
}
if !*configTest {
ctrl.Start()
ctrl.ShutdownBlock()
wait, err := ctrl.Start()
if err != nil {
util.LogWithContextIfNeeded("Error while running", err, l)
os.Exit(1)
}
go ctrl.ShutdownBlock()
wait()
l.Info("Goodbye")
}
os.Exit(0)
+10 -2
View File
@@ -72,9 +72,17 @@ func main() {
}
if !*configTest {
ctrl.Start()
wait, err := ctrl.Start()
if err != nil {
util.LogWithContextIfNeeded("Error while running", err, l)
os.Exit(1)
}
go ctrl.ShutdownBlock()
notifyReady(l)
ctrl.ShutdownBlock()
wait()
l.Info("Goodbye")
}
os.Exit(0)