Skip to content

Every day at specific time runs the job instantly #1

@gordonpn

Description

@gordonpn

I had the scheduler set up as follows:

scheduler := clockwork.NewScheduler()
scheduler.Schedule().Every().Days().At("10:00").Do(job)
scheduler.Run()

I also tried with

scheduler.Schedule().Every(1).Days().At("10:00").Do(job)
scheduler.Schedule().Every().Day().At("10:00").Do(job)
scheduler.Schedule().Every(1).Day().At("10:00").Do(job)

My goal is to only execute the job daily at 10 am.

They all ran my job as soon as I executed my code. Is there something I'm missing?
Thanks

Edit:
It seems that if a job is scheduled for 10 am at every day, but that time as passed today, it will run to make up for that missed time. Is that intended?

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