Skip to content

Commit 135a251

Browse files
committed
fix: apply
1 parent 1d4e253 commit 135a251

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

codeforlife/tests/celery.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ def apply_periodic_task(self, beat_name: str):
3838
beat = t.cast(CeleryBeatSchedule, self.app.conf.beat_schedule)[
3939
beat_name
4040
]
41-
4241
task_dot_path = (
4342
beat["task"].removeprefix(f"{settings.SERVICE_NAME}.").split(".")
4443
)
4544
task_module = ".".join(task_dot_path[:-1])
4645
task_name = task_dot_path[-1]
4746
task: Task = getattr(import_module(task_module), task_name)
48-
49-
args, kwargs = beat.get("args", tuple()), beat.get("kwargs", {})
50-
task.apply(*args, **kwargs)
47+
task.apply(args=beat.get("args"), kwargs=beat.get("kwargs"))
5148

5249
def apply_task(
5350
self,
@@ -63,4 +60,4 @@ def apply_task(
6360
kwargs: The keyword args to pass to the task.
6461
"""
6562
task: Task = self.app.tasks[f"{settings.SERVICE_NAME}.{name}"]
66-
task.apply(*(args or tuple()), **(kwargs or {}))
63+
task.apply(args=args, kwargs=kwargs)

0 commit comments

Comments
 (0)