add cron to loop

This commit is contained in:
bel
2021-07-17 23:35:24 -06:00
parent c2ed541604
commit f84614a8da
3 changed files with 15 additions and 7 deletions

View File

@@ -8,10 +8,10 @@ import (
type Cron string
func (c Cron) Next() time.Time {
func (c Cron) Next(since time.Time) time.Time {
schedule, err := cron.ParseStandard(string(c))
if err != nil {
return time.Time{}
}
return schedule.Next(time.Now())
return schedule.Next(since)
}