Skip to content

Job is not scheduled immediately #396

Description

@beantowel

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()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions