-
Notifications
You must be signed in to change notification settings - Fork 17
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
Cron optimizations #8
base: master
Are you sure you want to change the base?
Conversation
- It is now possible to use "0" as interval to have the script just run once and then exit (useful in cron jobs) - Fixed a bug where script was not sleeping on error before trying again
Interesting idea, thanks! Can you rebase this on current master? |
Conflicts: dbdownload/dbdownload.py
It should work now, didn't test it. |
@coandco LGTM, can you also take a look? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One quick fix, and I think this should be good to go.
self._logger.debug('sleeping for %d seconds' % self.sleep) | ||
time.sleep(self.sleep) | ||
# Done processing delta | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the "while True" is in start() now, there's no reason to have a "while True" loop in _monitor. Remove the _monitor while loop, and I think these changes should be good to go.
Hi,
thank you for sharing this script!
I've added a couple of features to have it better run as a cron job. Feel free to merge them if you are interested.