File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 7
7
8
8
import typing as t
9
9
10
+ from celery import schedules
10
11
from celery import shared_task as _shared_task
11
12
from django .conf import settings
12
13
13
14
from .types import Args , KwArgs
14
15
15
- if t .TYPE_CHECKING :
16
- from celery .schedules import crontab , solar
17
-
18
16
19
17
class CeleryBeat (t .Dict [str , t .Any ]):
20
18
"""A Celery beat schedule.
21
19
22
20
https://docs.celeryq.dev/en/v5.4.0/userguide/periodic-tasks.html
23
21
"""
24
22
23
+ # Shorthand for convenience.
24
+ crontab = schedules .crontab
25
+ solar = schedules .solar
26
+
25
27
def __init__ (
26
28
self ,
27
29
task : str ,
28
- schedule : t .Union [int , " crontab" , " solar" ],
30
+ schedule : t .Union [int , schedules . crontab , schedules . solar ],
29
31
args : t .Optional [Args ] = None ,
30
32
kwargs : t .Optional [KwArgs ] = None ,
31
33
):
You can’t perform that action at this time.
0 commit comments