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 4
4
5
5
from django_tasks .task import DEFAULT_QUEUE_NAME
6
6
7
-
8
7
# Set the default Django settings module for the 'celery' program.
9
8
django_settings = os .environ .get ('DJANGO_SETTINGS_MODULE' )
10
9
if django_settings is None :
19
18
app .config_from_object ('django.conf:settings' , namespace = 'CELERY' )
20
19
21
20
app .conf .task_default_queue = DEFAULT_QUEUE_NAME
21
+
22
+ app .autodiscover_tasks ()
Original file line number Diff line number Diff line change 1
1
from typing import TypeVar
2
2
3
- from typing_extensions import ParamSpec
4
-
5
3
from celery import shared_task
4
+ from celery .app import default_app
6
5
from celery .local import Proxy as CeleryTaskProxy
6
+ from typing_extensions import ParamSpec
7
+
7
8
from django_tasks .backends .base import BaseTaskBackend
8
9
from django_tasks .task import Task , TaskResult
9
10
11
+ if not default_app :
12
+ from django_tasks .backends .celery .app import app as celery_app
13
+ celery_app .set_default ()
14
+
10
15
11
16
T = TypeVar ("T" )
12
17
P = ParamSpec ("P" )
You can’t perform that action at this time.
0 commit comments