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

LongIntervalJob does not register runImmediately when days: 30 #193

Open
djdembeck opened this issue Jul 6, 2023 · 2 comments
Open

LongIntervalJob does not register runImmediately when days: 30 #193

djdembeck opened this issue Jul 6, 2023 · 2 comments

Comments

@djdembeck
Copy link

djdembeck commented Jul 6, 2023

I recently added this scheduler to a project, where we want to run a schedule every 30 days. In testing, SimpleIntervalJob Would run on server startup with runImmediately. When we changed to LongIntervalJob with the same settings, the task no longer runs on scheduler start.

We are using fastify-schedule, which is a wrapper for toad-scheduler. Here is the relevant startup code:
https://github.com/laxamentumtech/audnexus/blob/9e5dd5492c8a00e29791c3f53389ebf2d1739c68/src/server.ts#L124C1-L129

and the LongInterval code:

https://github.com/laxamentumtech/audnexus/blob/9e5dd5492c8a00e29791c3f53389ebf2d1739c68/src/helpers/utils/UpdateScheduler.ts#L120-L129

If we change the functions back to SimpleIntervalJob without changing anything else, the task runs immediately.

EDIT:
Upon further testing, if we change the interval from
{ days: 30, runImmediately: true }
->
{ days: 24, runImmediately: true },

the task does run immediately while using LongIntervalJob

@djdembeck djdembeck changed the title LongIntervalJob does not register runImmediately LongIntervalJob does not register runImmediately when days: 30 Jul 6, 2023
@kibertoad
Copy link
Owner

Thank you for the report! I'll check it out tomorrow.

@djdembeck
Copy link
Author

Thank you for the report! I'll check it out tomorrow.

Following up to see if you had a chance to look into this. Thanks!

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