From 3270e8308d136f57b5cc243d4190fdc8b008da69 Mon Sep 17 00:00:00 2001 From: nikilase Date: Thu, 4 Apr 2024 16:50:24 +0200 Subject: [PATCH] Changeover from schedule to apscheduler --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 37ab218..0eae4e6 100644 --- a/main.py +++ b/main.py @@ -22,15 +22,17 @@ def main(): def main_apscheduler(): + scheduler = BlockingScheduler() try: - scheduler = BlockingScheduler() + scheduler.add_job(k_m, "cron", second="0/10") scheduler.add_job(a_m, "cron", minute="0/5") scheduler.start() except KeyboardInterrupt: print("Shutting down from Keyboard Interrupt!") + scheduler.shutdown(wait=False) sys.exit() if __name__ == "__main__": - main() + main_apscheduler()