mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-09-20 13:30:50 +02:00
reverted autorecover panic handling for the cli commands
This commit is contained in:
+4
-5
@@ -12,7 +12,6 @@ import (
|
||||
"github.com/pocketbase/pocketbase/cmd"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/pocketbase/pocketbase/tools/list"
|
||||
"github.com/pocketbase/pocketbase/tools/routine"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -157,21 +156,21 @@ func (pb *PocketBase) Execute() error {
|
||||
done := make(chan bool, 1)
|
||||
|
||||
// listen for interrupt signal to gracefully shutdown the application
|
||||
routine.FireAndForget(func() {
|
||||
go func() {
|
||||
sigch := make(chan os.Signal, 1)
|
||||
signal.Notify(sigch, os.Interrupt, syscall.SIGTERM)
|
||||
<-sigch
|
||||
|
||||
done <- true
|
||||
})
|
||||
}()
|
||||
|
||||
// execute the root command
|
||||
routine.FireAndForget(func() {
|
||||
go func() {
|
||||
// note: leave to the commands to decide whether to print their error
|
||||
pb.RootCmd.Execute()
|
||||
|
||||
done <- true
|
||||
})
|
||||
}()
|
||||
|
||||
<-done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user