Crontap / crontap

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

Predictable human interval #8

Open danmindru opened 7 months ago

danmindru commented 7 months ago

Human intervals currently work on increments from the time of submission. So if you create a schedule at 12:07:01 for 10 minutes:

However, there should be a mode for this to run predictably like cron, but the only way to do that is to allow users to set the start date as opposed to "now".

If you could say the start date is 12:10:00, then we can do the next at 12:20:00 etc. however this is a bit more tricky with monthly values.

Perhaps one approach to solve this would be to convert human readable to a cron so it works more predictably, if possible.

francistogram commented 7 months ago

Question for you: would it make sense to do the same thing that cron syntax does which is assume start date is the beginning of the day and then find the nearest interval e.g. every 5 minutes really means every 5 minutes after 12:00:00am

So if I input "5 minutes" it'd calculate all of these 5 minute intervals and then when saved the start time would be set to the soonest interval?

danmindru commented 6 months ago

That'll be a reasonable implementation! However, it might be a bit confusing if your interval is "1 day and 12 hours".

If the current date/time is 01.01.24 13:00, you'd expect the next run to be at 03.01.24 01:00 However if we take 12AM as the start, the actual next run will be at 02.01.24 12:00

Perhaps that's not an issue if it's clearly stated, but I am beginning to think the ability to specify a start date is a requirement here.