mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-22 05:54:06 +02:00
added default panic-recover handling for the cron jobs
This commit is contained in:
1 parent
f3ae7731d4
commit
40d2849aa6
3 files changed
+6
-2
No files matched your search
+3
-1
@@ -14,6 +14,8 @@ import (
|
||||
"slices"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/pocketbase/tools/routine"
|
||||
)
|
||||
|
||||
// Cron is a crontab-like struct for tasks/jobs scheduling.
|
||||
@@ -222,7 +224,7 @@ func (c *Cron) runDue(t time.Time) {
|
||||
|
||||
for _, j := range c.jobs {
|
||||
if j.schedule.IsDue(moment) {
|
||||
go j.Run()
|
||||
routine.FireAndForget(j.Run)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user