Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doOnce on set intervals does not work as expected #96

Closed
Martmists-GH opened this issue Feb 10, 2024 · 6 comments
Closed

doOnce on set intervals does not work as expected #96

Martmists-GH opened this issue Feb 10, 2024 · 6 comments

Comments

@Martmists-GH
Copy link

Martmists-GH commented Feb 10, 2024

Example code:

doOnce("* 0/2 * * *") {
    println("Hello World!")
}

Expected behavior: prints "Hello World!" once every other minute.

Actial Behavior: Seems to trigger only once or twice

Copy link

Welcome with your first issue

@InsanusMokrassar
Copy link
Owner

Example code:

doOnce("* 0/2 * * *") {
    println("Hello World!")
}

Expected behavior: prints "Hello World!" once every other minute.

Actial Behavior: Seems to trigger only once or twice

Hi :) doOnce functions trigger callback only once (if twice - it is error, please, feel free to report that case). You may read docs to get more info about available ways to trigger actions by krontab string :)

@Martmists-GH
Copy link
Author

Martmists-GH commented Feb 11, 2024

That'd make sense, but doWhile and doInfinity trigger every second with this configuration, even though it should only be once every 2 minutes to my knowledge, so I'm unsure what to do here to get the desired result.

@InsanusMokrassar
Copy link
Owner

That'd make sense, but doWhile and doInfinity trigger every second with this configuration, even though it should only be once every 2 minutes to my knowledge, so I'm unsure what to do here to get the desired result.

Look here for your krontab settings explanation

@Martmists-GH
Copy link
Author

oh, so it's different from regular cron format in that regard?

@InsanusMokrassar
Copy link
Owner

oh, so it's different from regular cron format in that regard?

Yes, all the differences described in docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants