add cron to loop
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user