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 d64d8a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 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,7 @@ 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 settings.CELERY_ALWAYS_EAGER:
logger.debug('Scheduling task %s if transaction block is '
'successful' % (t.description))
task_queue_stack[-1].append(t)
Expand Down

0 comments on commit d64d8a0

Please sign in to comment.