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

Jobs in the database vs jobs defined #53

Open
christian-schwaderer opened this issue Aug 23, 2024 · 0 comments
Open

Jobs in the database vs jobs defined #53

christian-schwaderer opened this issue Aug 23, 2024 · 0 comments

Comments

@christian-schwaderer
Copy link

I think there is a problem between the concepts of "defined jobs" and "jobs stored in the database".

My situation is like this: I have cronjob to run once per day. The task of the cronjob is to fetch some entities from the DB and then create one cronjob per entity.
The cronjob will first fetch all jobs via job, then check if there is already a job for some entity. If there is already a job, there is nothing to do.
At least, I thought so.
However, it does not seem to be the case.
After a restart of the server, the cronjobs created by the main job never get executed - despite being found with the jobs method. I think the reason is that the jobs never get to run define() upon server restart. And I guess I have found a workaround by just running await job.save() on every job.

However, I think this should be addressed somehow, or at least documented.

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

1 participant