Commit 58159155 by Edward Zarecor

refactoring for new scheduler

parent c3e8861c
...@@ -7,7 +7,7 @@ from notifier.tasks import do_forums_digests ...@@ -7,7 +7,7 @@ from notifier.tasks import do_forums_digests
# As it's name implies, when started, this Scheduler will block until forcibly stopped. # As it's name implies, when started, this Scheduler will block until forcibly stopped.
sched = BlockingScheduler(standalone=True) sched = BlockingScheduler(standalone=True)
@sched.cron_schedule(**settings.DIGEST_CRON_SCHEDULE)
def digest_job(): def digest_job():
do_forums_digests.delay() do_forums_digests.delay()
...@@ -26,4 +26,5 @@ class Command(BaseCommand): ...@@ -26,4 +26,5 @@ class Command(BaseCommand):
""" """
def handle(self, *args, **options): def handle(self, *args, **options):
sched.add_job(digest_job, 'cron', **settings.DIGEST_CRON_SCHEDULE)
sched.start() sched.start()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment