1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-01-08 09:14:37 +02:00

renamed variable name

This commit is contained in:
Gani Georgiev 2023-07-31 17:48:26 +03:00
parent 9254ce46eb
commit b33ad36f64

View File

@ -105,7 +105,7 @@ func hooksBinds(app core.App, loader *goja.Runtime, executors *vmsPool) {
func cronBinds(app core.App, loader *goja.Runtime, executors *vmsPool) { func cronBinds(app core.App, loader *goja.Runtime, executors *vmsPool) {
scheduler := cron.New() scheduler := cron.New()
var hasServeInited bool var wasServeTriggered bool
loader.Set("cronAdd", func(jobId, cronExpr, handler string) { loader.Set("cronAdd", func(jobId, cronExpr, handler string) {
pr := goja.MustCompile("", "{("+handler+").apply(undefined)}", true) pr := goja.MustCompile("", "{("+handler+").apply(undefined)}", true)
@ -121,7 +121,7 @@ func cronBinds(app core.App, loader *goja.Runtime, executors *vmsPool) {
} }
// start the ticker (if not already) // start the ticker (if not already)
if hasServeInited && scheduler.Total() > 0 && !scheduler.HasStarted() { if wasServeTriggered && scheduler.Total() > 0 && !scheduler.HasStarted() {
scheduler.Start() scheduler.Start()
} }
}) })
@ -141,7 +141,7 @@ func cronBinds(app core.App, loader *goja.Runtime, executors *vmsPool) {
scheduler.Start() scheduler.Start()
} }
hasServeInited = true wasServeTriggered = true
return nil return nil
}) })