InsanusMokrassar / krontab

Library for using Crontab-like syntax in scheduling of some Kotlin Coroutines tasks to do from time to time

Home Page:https://docs.inmo.dev/krontab/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0 0 0 1 * - infinite loop

evgenru opened this issue · comments

buildSchedule("0 0 0 1 *").next(DateTime(Date().time))

Welcome with your first issue

Could you please show an output of buildSchedule("0 0 0 1 *").next()?

I can't. infinite loop in next() :)

Hello, I have checked with the next code:

suspend fun main() {
    val next = buildSchedule("0 0 0 1 *").next()
    println(next ?.format(DateFormat.DEFAULT_FORMAT))
}

And got an output: Tue, 01 Feb 2022 00:00:00 UTC

So, looks like there is no any loop here. Could you provide more info (project link or some code sample) to let me help you?

Unfortunately, it has already been removed from the project.
But when I researched, in this place there was dayOfMonth = 2 number:

02/02/2022...03/02/2022...04/02/2022... and so on in the bexon cycle

It looks like correct behaviour. The library will give date/time queue according to the configuration (in your case it is 0 seconds, 0 minutes, 0 hours of each second day in any month). In library there are built-in confersations to the flows and different other tools to work with the result of next method. What is your case?

bexon cycle in method next, without return. method freezes

Hello, could you send the target platform, timezone and environment info?

@evgenru hi, do you have telegram? I would like to talk to you there for more information

The solution for that bug will be available in 0.7.3 version.

I'd like to attract your attention to the fact, that days in string format of kron is starting since 0

P.S. Sorry for the delay in fix