Use celery_once to prevent repeat task queueing.

Prevent group updates from being queued multiple times per user.

Default graceful to prevent raising exceptions.
This commit is contained in:
Adarnof
2018-03-19 20:39:27 -04:00
parent 20236cab8a
commit 73e6f576f4
12 changed files with 38 additions and 15 deletions

View File

@@ -11,6 +11,13 @@ app = Celery('{{ project_name }}')
# Using a string here means the worker don't have to serialize
# the configuration object to child processes.
app.config_from_object('django.conf:settings')
app.conf.ONCE = {
'backend': 'celery_once.backends.Redis',
'settings': {
'url': 'redis://localhost:6379/0',
'default_timeout': 60 * 60
}
}
# Load task modules from all registered Django app configs.
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)