Commit c3e8861c by Edward Zarecor

refactoring use of deprecated scheduler

parent c796fb70
.idea/
*.pyc *.pyc
*.swp *.swp
notifier.db notifier.db
......
from apscheduler.scheduler import Scheduler from apscheduler.schedulers.blocking import BlockingScheduler
from django.conf import settings from django.conf import settings
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from notifier.tasks import do_forums_digests from notifier.tasks import do_forums_digests
# N.B. standalone=True means that sched.start() will block until forcibly stopped. # As it's name implies, when started, this Scheduler will block until forcibly stopped.
sched = Scheduler(standalone=True) sched = BlockingScheduler(standalone=True)
@sched.cron_schedule(**settings.DIGEST_CRON_SCHEDULE) @sched.cron_schedule(**settings.DIGEST_CRON_SCHEDULE)
def digest_job(): def digest_job():
......
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