Skip to content

Commit bb8799b

Browse files
committed
fix paths
1 parent 0fd058c commit bb8799b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

codeforlife/tasks.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,27 @@
77

88
import typing as t
99

10+
from celery import schedules
1011
from celery import shared_task as _shared_task
1112
from django.conf import settings
1213

1314
from .types import Args, KwArgs
1415

15-
if t.TYPE_CHECKING:
16-
from celery.schedules import crontab, solar
17-
1816

1917
class CeleryBeat(t.Dict[str, t.Any]):
2018
"""A Celery beat schedule.
2119
2220
https://docs.celeryq.dev/en/v5.4.0/userguide/periodic-tasks.html
2321
"""
2422

23+
# Shorthand for convenience.
24+
crontab = schedules.crontab
25+
solar = schedules.solar
26+
2527
def __init__(
2628
self,
2729
task: str,
28-
schedule: t.Union[int, "crontab", "solar"],
30+
schedule: t.Union[int, schedules.crontab, schedules.solar],
2931
args: t.Optional[Args] = None,
3032
kwargs: t.Optional[KwArgs] = None,
3133
):

0 commit comments

Comments
 (0)