refactor: use WaitGroup.Go to simplify code

Signed-off-by: asttool <asttool@outlook.com>
pull/5162/head
asttool 4 days ago
parent d7e751997d
commit cf8f6de28a

@ -306,11 +306,9 @@ func (c *Cron) runScheduler() {
// startJob runs the given job in a new goroutine.
func (c *Cron) startJob(j Job) {
c.jobWaiter.Add(1)
go func() {
defer c.jobWaiter.Done()
c.jobWaiter.Go(func() {
j.Run()
}()
})
}
// now returns current time in c location.

Loading…
Cancel
Save