-
Notifications
You must be signed in to change notification settings - Fork 625
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
Delayed Jobs with suspend #671
Comments
your computer suspends on a schedule? does it automatically un-suspend? my guess is the here's what the
if you can log out the results of |
I suspend my computer when I go to sleep and i wake the computer up when I start working next morning. I will have a look at your suggestion and get back here if I am able to better reproduce it. |
I created a minimal-reproducable example with both
Dockerized into an image based on
Wait couple of days with computer going to sleep over night more or less and then checking the log:
Note: 11am UTC is 1pm Europe/Berlin. So the first trigger is on point, 2nd and 3rd are |
Thanks for great research @mindrunner 💯 I think the problem is that setTimeout (used internally by node-cron and other similar libraries) is paused when the computer (and/or container) is suspended, so if next run is 10 000 000 ms away and the computer is suspended 8 000 000 ms, the function will be run 8 000 000 ms too late. Need to test this with and without container to see if it's a docker issue or general issue. Docker or not, the solution would be to chop the waiting into smaller chunks, and if the chunks are small enough, there will be no problem when the computer is suspended. ( The node-cron-folks do not like it when I comment their issues (citing an email i got) "advertising competing libraries". Thats why my question got deleted. To whom it may concern - sorry, will try to avoid that. ) |
Description
For testing purpose, I have one of my services running on my local computer which suspends over night.
There is only one cron job which is supposed to run early afternoon:
HARVEST_INTERVAL='0 13 * * *'
Jobs are currently executed around 10pm-11pm. Cannot find a pattern actually. I suspect suspend is somehow the issue, but idk why... Time in container is always correct.
Application is dockerized and lives in a
docker-compose
setup if that matters.TZ
env is set correctly and generally everything is working fine (same app does not show that behavior on a 24/7 running server.Any ideas?
Screenshots
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: