Skip to content

Commit

Permalink
basic async case processing
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyroberts committed Feb 13, 2014
1 parent ef1facb commit 108056d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions casexml/apps/case/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def process_cases(sender, xform, config=None, **kwargs):

@log_exception()
def _process_cases(sender, xform, config=None, **kwargs):
from casexml.apps.case import process_cases
process_cases(xform, config)
from casexml.apps.case.tasks import process_cases
process_cases.delay(xform, config)


successful_form_received.connect(_process_cases)
Expand Down
7 changes: 7 additions & 0 deletions casexml/apps/case/tasks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from celery.task import task


@task
def process_cases(xform, config=None):
from casexml.apps.case import process_cases
process_cases(xform, config)

0 comments on commit 108056d

Please sign in to comment.