regenerated jsvm types and added locks for the startTimer

This commit is contained in:
Gani Georgiev 2024-02-21 22:42:01 +02:00
parent 5a715cc60a
commit 4fba93e834
2 changed files with 774 additions and 774 deletions

File diff suppressed because it is too large Load Diff

View File

@ -157,6 +157,7 @@ func (c *Cron) Start() {
next := now.Add(c.interval).Truncate(c.interval) next := now.Add(c.interval).Truncate(c.interval)
delay := next.Sub(now) delay := next.Sub(now)
c.Lock()
c.startTimer = time.AfterFunc(delay, func() { c.startTimer = time.AfterFunc(delay, func() {
c.Lock() c.Lock()
c.ticker = time.NewTicker(c.interval) c.ticker = time.NewTicker(c.interval)
@ -172,6 +173,7 @@ func (c *Cron) Start() {
} }
}() }()
}) })
c.Unlock()
} }
// HasStarted checks whether the current Cron ticker has been started. // HasStarted checks whether the current Cron ticker has been started.