regenerated jsvm types and added locks for the startTimer
This commit is contained in:
parent
5a715cc60a
commit
4fba93e834
File diff suppressed because it is too large
Load Diff
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue