Skip to content

Commit

Permalink
Update signature for delay_on_commit and apply_async_on_commit
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebroke committed Apr 27, 2024
1 parent e515a3c commit a054ce9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions celery/contrib/django/task.py
Expand Up @@ -12,10 +12,10 @@ class DjangoTask(Task):
Provide a nicer API to trigger tasks at the end of the DB transaction.
"""

def delay_on_commit(self, *args, **kwargs):
def delay_on_commit(self, *args, **kwargs) -> None:
"""Call :meth:`~celery.app.task.Task.delay` with Django's ``on_commit()``."""
return transaction.on_commit(functools.partial(self.delay, *args, **kwargs))
transaction.on_commit(functools.partial(self.delay, *args, **kwargs))

def apply_async_on_commit(self, *args, **kwargs):
def apply_async_on_commit(self, *args, **kwargs) -> None:
"""Call :meth:`~celery.app.task.Task.apply_async` with Django's ``on_commit()``."""
return transaction.on_commit(functools.partial(self.apply_async, *args, **kwargs))
transaction.on_commit(functools.partial(self.apply_async, *args, **kwargs))

0 comments on commit a054ce9

Please sign in to comment.