jasonlvhit / gocron

A Golang Job Scheduling Package.
BSD 2-Clause "Simplified" License
3.45k stars 345 forks source link

Cannot Run Job on Sunday 8:00 AM UTC #49

Open markvincentcaro opened 6 years ago

markvincentcaro commented 6 years ago

I have added logs to my application whenever it runs my Job to make sure it has properly executed.

When I schedule my Job on Sunday 8:00 AM UTC, it fails to execute (no logs generated):

// Run function every Sunday at 8:00 AM UTC
go func() {
    gocron.ChangeLoc(time.UTC)    
    gocron.Every(1).Sunday().At("08:00").Do(MyFunction)        
    <- gocron.Start()
}()

However, if I schedule the Job on a different day (e.g. Thursday), it executes (logs were generated):

// Run function every Thursday at 8:00 AM UTC
go func() {
    gocron.ChangeLoc(time.UTC)    
    gocron.Every(1).Thursday().At("08:00").Do(MyFunction)        
    <- gocron.Start()
}()

Is there something I am doing wrong when scheduling my Job on Sunday 8:00 AM UTC, or is there an issue with using gocron for this specific interval?

WingGao commented 6 years ago

same as Days()

piotrkochan commented 4 years ago

Bump, anyone? Is is almost a Year now. I have similar issues.

iambudi commented 4 years ago

Same thing happen, gocron suddenly does not trigger at certain hour.

go func(config *Config) {
    gocron.Every(1).Day().At("22:00").Do(something, config)
    gocron.Every(1).Day().At("14:00").Do(somethingElse, config)
    <-gocron.Start()
}(config)

It works only at 14:00 but 22:00 no run at all. Is it a bug or has to do with machine time setting?

iambudi commented 4 years ago

Same thing happen, gocron suddenly does not trigger at certain hour.

go func(config *Config) {
    gocron.Every(1).Day().At("22:00").Do(something, config)
    gocron.Every(1).Day().At("14:00").Do(somethingElse, config)
    <-gocron.Start()
}(config)

It works only at 14:00 but 22:00 no run at all. Is it a bug or has to do with machine time setting?

Solved, after debugging it's in my fault. My Apologize for this.