File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
django_tasks/backends/celery Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 44
55from django_tasks .task import DEFAULT_QUEUE_NAME
66
7-
87# Set the default Django settings module for the 'celery' program.
98django_settings = os .environ .get ('DJANGO_SETTINGS_MODULE' )
109if django_settings is None :
1918app .config_from_object ('django.conf:settings' , namespace = 'CELERY' )
2019
2120app .conf .task_default_queue = DEFAULT_QUEUE_NAME
21+
22+ app .autodiscover_tasks ()
Original file line number Diff line number Diff line change 11from typing import TypeVar
22
3- from typing_extensions import ParamSpec
4-
53from celery import shared_task
4+ from celery .app import default_app
65from celery .local import Proxy as CeleryTaskProxy
6+ from typing_extensions import ParamSpec
7+
78from django_tasks .backends .base import BaseTaskBackend
89from django_tasks .task import Task , TaskResult
910
11+ if not default_app :
12+ from django_tasks .backends .celery .app import app as celery_app
13+ celery_app .set_default ()
14+
1015
1116T = TypeVar ("T" )
1217P = ParamSpec ("P" )
You can’t perform that action at this time.
0 commit comments