Closed TaridaGeorge closed 1 year ago
As far as I can tell, your cron expression says "every second", as you're using the six positions syntax.
But then why does iter.get_next(datetime) returns 00:00:02 then 00:00:04 then again 00:01:02, 00:01:04?
I'm sorry, I didn't look close enough. I've always thought that the seconds field was the first field (when using seconds).
I had a closer look now. croniter only matches for minute precision cron expressions. Refer to line 806: https://github.com/kiorky/croniter/blob/master/src/croniter/croniter.py#L806
I'm not sure if this is something that has been overlooked or if it's intentional.
Yes. That seems to be the problem. It only matches for minute precision.
as said on #18
Sorry but i'm afraid croniter mostly stick with UNIX like cron.
You may submit a PR to add the support, through.
@kiorky Shouldn't croniter just choose more definitively whether it supports seconds or not? The functionality is kind of half-implemented now. Would you welcome a PR that fixes this?
Its on the README: croniter iterates along with cron_format from start_time. cron_format is min hour day month day_of_week,
(And yes, as always, i would greatly appreciate a PR where things may be clearer)
PR are always welcome !
I'm trying to understand why does this croniter.match call returns True:
Output is:
You can see that I'm matching it against a datetime that has 1 in the seconds place. Is this the indented behavior or is it a bug?