From b33ad36f64842c649adc9914cfa447e841e20356 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Mon, 31 Jul 2023 17:48:26 +0300 Subject: [PATCH] renamed variable name --- plugins/jsvm/binds.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/jsvm/binds.go b/plugins/jsvm/binds.go index b3b3174e..ec02cfaa 100644 --- a/plugins/jsvm/binds.go +++ b/plugins/jsvm/binds.go @@ -105,7 +105,7 @@ func hooksBinds(app core.App, loader *goja.Runtime, executors *vmsPool) { func cronBinds(app core.App, loader *goja.Runtime, executors *vmsPool) { scheduler := cron.New() - var hasServeInited bool + var wasServeTriggered bool loader.Set("cronAdd", func(jobId, cronExpr, handler string) { 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) - if hasServeInited && scheduler.Total() > 0 && !scheduler.HasStarted() { + if wasServeTriggered && scheduler.Total() > 0 && !scheduler.HasStarted() { scheduler.Start() } }) @@ -141,7 +141,7 @@ func cronBinds(app core.App, loader *goja.Runtime, executors *vmsPool) { scheduler.Start() } - hasServeInited = true + wasServeTriggered = true return nil })