Last active
May 3, 2021 14:40
-
-
Save osharaki/356261a9618a87606ca02a8bace293b4 to your computer and use it in GitHub Desktop.
Unogs API miner: task scheduler (snippet 4/6)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if args.exec_time == "now": | |
job() | |
if not done: | |
# Prevent scheduling in case of permanent termination | |
schedule.every().day.at(default_time).do(job) | |
else: | |
schedule.every().day.at(args.exec_time).do(job) | |
while True: | |
if done: | |
break | |
n = schedule.idle_seconds() | |
if n >= 0: | |
time.sleep(n) | |
remaining_quota = buffer + 1 | |
schedule.run_pending() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment