Crontap / crontap

Schedule recurring API calls without the hassle
https://crontap.com
11 stars 0 forks source link

Bug: */5 * * * * vs 5 minutes #6

Closed francistogram closed 7 months ago

francistogram commented 7 months ago

These two unexpectedly do different things

*/5 * * * *

Will post every 5 minutes at the 0 and 5 minute intervals

image

5 minutes

Will post every 5 minutes but unclear the starting point. I assume it's when the schedule was created but unclear until it's been scheduled

image

I'd personally prefer to use the human readable format but because of this limitation I end up writing everything using the cron syntax

danmindru commented 7 months ago

It would have a slightly different effect, the human readable syntax is 5 minutes from the point of submission, so say you submit the schedule at 21:23:05, the next will be at 21:28:05 and so on.

But it'll be excellent to convey this through the description indeed.

francistogram commented 7 months ago

Yeah I mean I'd expect them to be the same given that taking */5 * * * * to human readable is "Every 5 minutes" but then going the other way and inputting every 5 minutes gives every 5 minutes but at a different interval

Also I think as a developer that for having things to be more predictable e.g. on a :00 or :05 is so much more preferable to every 5 minutes at the current starting point

danmindru commented 7 months ago

I see, that makes sense. It would require a start date then, because cron kind of has both start date and schedule at the same time :) Added a new issue, but this might require a bit of a rework to get right (#8)

For now made the description more clear at least and made it a bit nicer to work with (see #7).