Unverified Commit 54e3c134 authored by asttool's avatar asttool Committed by GitHub

refactor: use WaitGroup.Go to simplify code (#5162)

Signed-off-by: 's avatarasttool <asttool@outlook.com>
parent d7e75199
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment