use celerybeat

This commit is contained in:
2019-01-26 12:36:44 +03:00
parent 6a88f7da4b
commit ec01ab879f
8 changed files with 32 additions and 25 deletions

View File

@@ -8,6 +8,16 @@ app = Celery('telegram_bots')
app.config_from_object({
'broker_url': 'redis://127.0.0.1:6379/1',
'result_backend': 'django-db',
'beat_scheduler': 'django_celery_beat.schedulers:DatabaseScheduler',
'worker_concurrency': 4,
'ONCE': {
'backend': 'celery_once.backends.Redis',
'settings': {
'url': 'redis://localhost:6379/0',
'default_timeout': 60 * 60,
}
}
})
app.autodiscover_tasks()