Unable to parse a range (strconv.Atoi error)
I am getting this error
failed to parse int from 1-4: strconv.Atoi: parsing "1-4": invalid syntax
from the cron string "*/1-4 * * * *"
Please let me know if this is just me being stupid or a bug. Because afaik ranges should be supported as a hyphen is an accepted character.
I believe ranges are not expected as the divisor, but they definitely work prior to the slash. The error handling could probably be better. What schedule are you trying to create?
Refer here to Slash usage: https://en.wikipedia.org/wiki/Cron
I'm trying to create this schedule here. https://cronexpressiondescriptor.azurewebsites.net/?expression=%2F1-4++++*&locale=en
Running a job every 1-4 minutes. Though on closer inspection this isn't what I need anyway. But currently you don't support ranges as the divisor?
Do you mean running a job each minute on minutes 1-4 of each hour? That would be "1-4", not "*/1-4".
Otherwise, that schedule doesn't make sense to me.. To take the first element in the range: let's say you run a job every 1 minute. Now we take the second element of the range, 2. How does that change the schedule?
Sorry for leaving this open. I believe I was trying to have a job run at intervals of 1,2,3, or 4 minutes. That is my best guess. Not sure if cron even supports such a thing? I've been (possibly incorrectly) relying on this website https://cronexpressiondescriptor.azurewebsites.net/?expression=%2F1-4++++*&locale=en for cron descriptions.
Either way I have no need to do this anymore and you can consider this a user error. Thanks for your time.