Skip to content

Commit

Permalink
During testing do not postpone execution of the tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Delaby committed Nov 7, 2014
1 parent 5233828 commit 2dfe1fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django_atomic_celery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import threading
from collections import defaultdict
from celery.task import task as base_task, Task
from django.conf import settings
from django.dispatch import receiver
from django.db import DEFAULT_DB_ALIAS
from functools import partial
Expand Down Expand Up @@ -91,7 +92,8 @@ def apply_async(cls, args=(), kwargs=None, *a, **kw):

t = ConditionalTask(cls, args, kwargs, *a, **kw)

if task_queue_stack:
if task_queue_stack and not getattr(settings,
'CELERY_ALWAYS_EAGER', False):
logger.debug('Scheduling task %s if transaction block is '
'successful' % (t.description))
task_queue_stack[-1].append(t)
Expand Down

0 comments on commit 2dfe1fe

Please sign in to comment.