Job is not scheduled as described as in the doc
You may also schedule a job to execute at fixed intervals, starting at the time it's added or cron is run
For example, the code below will only print once "cron scheduled" instead of twice as expected.
func TestCron(t *testing.T) {
c := cron.New()
c.Start()
c.AddFunc("@every 15s", func() {
t.Logf("cron scheduled")
})
time.Sleep(time.Second * 20)
c.Stop()
}
Job is not scheduled as described as in the doc
For example, the code below will only print once "cron scheduled" instead of twice as expected.