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
+3 -2
View File
@@ -10,6 +10,7 @@ import (
"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/tools/dbutils"
"github.com/pocketbase/pocketbase/tools/inflector"
"github.com/pocketbase/pocketbase/tools/routine"
"golang.org/x/sync/errgroup"
)
@@ -336,8 +337,8 @@ func (s *Provider) Exec(items any) (*Result, error) {
if !s.skipTotal {
// execute the 2 queries concurrently
errg := new(errgroup.Group)
errg.Go(countExec)
errg.Go(modelsExec)
errg.Go(routine.SafeWrap(countExec))
errg.Go(routine.SafeWrap(modelsExec))
if err := errg.Wait(); err != nil {
return nil, err
}