From e83e911b2f9deac92a12d9b4fe36c6f18c2a6ddf Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Wed, 29 Jul 2026 18:53:04 +0300 Subject: [PATCH] [#7781] reverted autorecover panic handling for the cli commands --- CHANGELOG.md | 2 ++ pocketbase.go | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7988ee3..30682b07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## v0.39.10 (WIP) +- Reverted the auto panic recover handling for the cli commands to allow a panic to force exit with non-zero code ([#7781](https://github.com/pocketbase/pocketbase/issues/7781)). + - Minor UI improvements (added placeholder loader for the logs chart). diff --git a/pocketbase.go b/pocketbase.go index 9f0e1a74..91b92c81 100644 --- a/pocketbase.go +++ b/pocketbase.go @@ -186,21 +186,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