mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-16 16:54:57 +01:00
fixed unhandled panic and wrapped all internal goroutines
This commit is contained in:
1 parent
a6deb6ab90
commit
30b4184305
11 files changed
+76
-22
No files matched your search
+4
-2
@@ -13,6 +13,8 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/pocketbase/tools/routine"
|
||||
)
|
||||
|
||||
type job struct {
|
||||
@@ -170,7 +172,7 @@ func (c *Cron) Start() {
|
||||
c.runDue(time.Now())
|
||||
|
||||
// run after each tick
|
||||
go func() {
|
||||
routine.FireAndForget(func() {
|
||||
for {
|
||||
select {
|
||||
case <-c.tickerDone:
|
||||
@@ -179,7 +181,7 @@ func (c *Cron) Start() {
|
||||
c.runDue(t)
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
})
|
||||
c.Unlock()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user