fixed unhandled panic and wrapped all internal goroutines

This commit is contained in:
Gani Georgiev
2026-07-15 12:03:07 +03:00
parent 09044ef7a3
commit f1618ee59b
13 changed files with 85 additions and 37 deletions
+4 -4
View File
@@ -186,21 +186,21 @@ func (pb *PocketBase) Execute() error {
done := make(chan bool, 1)
// listen for interrupt signal to gracefully shutdown the application
go func() {
routine.FireAndForget(func() {
sigch := make(chan os.Signal, 1)
signal.Notify(sigch, os.Interrupt, syscall.SIGTERM)
<-sigch
done <- true
}()
})
// execute the root command
go func() {
routine.FireAndForget(func() {
// note: leave to the commands to decide whether to print their error
pb.RootCmd.Execute()
done <- true
}()
})
<-done