Is it possible to run it every 2 hours but only between 9AM-9PM? #219
-
So, fo example, within one line is it possible to run with the next schedule? "09:00", "11:00", "13:00", "15:00", "17:00", "19:00", "21:00" Now I have to iterate through array and create it like this: s.Every(1).Day().At(time).Do(myLovelyFunc) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There isn’t currently support with the functions directly, although it would be nice to allow In the meantime you can accomplish what you want with the crontab schedule.
I used this link to generate that |
Beta Was this translation helpful? Give feedback.
There isn’t currently support with the functions directly, although it would be nice to allow
At(atTime string)
to accept instead a variadic valueAt(atTimes []string…)
.In the meantime you can accomplish what you want with the crontab schedule.
scheduler.Cron(“0 9,11,13,15,19,21 * * *”).Do()
I used this link to generate that