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
@@ -42,6 +42,7 @@ import (
"github.com/pocketbase/pocketbase/tools/filesystem/blob"
"github.com/pocketbase/pocketbase/tools/filesystem/internal/s3blob/s3"
"github.com/pocketbase/pocketbase/tools/routine"
)
const defaultPageSize = 1000
@@ -359,7 +360,7 @@ func (w *writer) Write(p []byte) (int, error) {
// error uploading to S3.
func (w *writer) open(r io.Reader, closePipeOnError bool) {
// This goroutine will keep running until Close, unless there's an error.
go func() {
routine.FireAndForget(func() {
defer func() {
close(w.donec)
}()
@@ -378,7 +379,7 @@ func (w *writer) open(r io.Reader, closePipeOnError bool) {
}
w.err = err
}
}()
})
}
// Close completes the writer and closes it. Any error occurring during write