def enable_housekeeping(run_interval=3600):
cease_continuous_run = threading.Event()
class ScheduleThread(threading.Thread):
@staticmethod
def run():
while not cease_continuous_run.is_set():
schedule.run_pending()
time.sleep(run_interval)
continuous_thread = ScheduleThread()
continuous_thread.start()
schedule.every(6).hours.do(LoggingNight.garbage_collect_cache)
评论列表
文章目录