From 61d48392882b20cb861834996684e107792c4269 Mon Sep 17 00:00:00 2001 From: Ishaan Mittal Date: Mon, 23 Oct 2023 23:07:29 +0530 Subject: [PATCH] update quick --- home/schedulers.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/home/schedulers.py b/home/schedulers.py index 6ad3096..cf1ce7e 100644 --- a/home/schedulers.py +++ b/home/schedulers.py @@ -9,9 +9,10 @@ except socket.error: print, "!!!scheduler already started, DO NOTHING" else: - scheduler = BackgroundScheduler() - scheduler.add_jobstore(DjangoJobStore(), "default") - scheduler.add_job(__send__rebate__email__, 'cron', hour=23, minute=59, second=0) - register_events(scheduler) - scheduler.start() - print, "scheduler started" + def start(): + scheduler = BackgroundScheduler() + scheduler.add_jobstore(DjangoJobStore(), "default") + scheduler.add_job(__send__rebate__email__, 'cron', hour=23, minute=59, second=0) + register_events(scheduler) + scheduler.start() + print, "scheduler started"