jasonlvhit / gocron

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

About task execution time #170

Open rtywei opened 3 years ago

rtywei commented 3 years ago

My task is set to execute time, but it does not take effect。 I want to execute once every minute, at 00 seconds 。So I used this method。 At。But the exection is 56 seconds。

For example, gocron.Every(1).Minute().At("00:00:00").Do(db.task) but run time is I0611 15:40:55.602110 image

JohnRoesler commented 3 years ago

Hi @rtywei - this repo is no longer maintained. Take a look at our active fork over at https://github.com/go-co-op/gocron

The At() method doesn't work with minutes. However, you could use StartAt() to get your task to start at the next minute using time and rounding.