Skip to content

Conversation

@robdewit
Copy link
Contributor

Avoid skipping a minute when system is under heavy load.

In fact this is just a hack on a weird part of code. I would expect this to work by calculating the number of seconds until the next minute just before the end of the loop, and then wait that calculated time directly after that. But this is not how the code works. Somehow this is done in the code by getting the current time at the start of the loop. Then, while in the loop, stuff happens (which takes time) and even a sleep(5) is done, but none of this is accounted for in the calculation of the sleep-time.

Maybe I am missing something, so I just lowered the (large) wait-time. Theoretically, the same thing can still happen if the calls in the loop take more than 30 seconds, but we'll settle for that.

@robdewit robdewit changed the title Patch 2 Avoid skipping a minute when system is under heavy load. Nov 30, 2018
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

Successfully merging this pull request may close these issues.

1 participant