osu-wayback/autoSchedule/__init__.py

20 lines
374 B
Python
Raw Permalink Normal View History

2019-03-11 16:14:03 +01:00
from time import time, sleep
from threading import Thread
from . import scrape
from objects import glob
def schedule_loop():
if glob.config["scrape"]["run_on_startup"]:
scrape.run()
while True:
_time = time() + glob.config["scrape"]["schedule_seconds"]
while _time - time() > 0:
sleep(1)
scrape.run()
thread = Thread(target = schedule_loop)
thread.start()