Skip to content

Commit

Permalink
Merge branch 'feature-wrap-all-celery-tasks-in-transactions'
Browse files Browse the repository at this point in the history
  • Loading branch information
Radoslaw Wrzesien committed Jun 20, 2018
2 parents a0aa853 + 806c027 commit 46a7605
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions concent_api/conductor/tasks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
from celery import shared_task
from django.db import transaction

from core import tasks
from utils.constants import ErrorCode
from utils.decorators import log_task_errors
Expand All @@ -19,6 +21,7 @@
@shared_task
@provides_concent_feature('conductor-worker')
@log_task_errors
@transaction.atomic(using='storage')
def blender_verification_request(
subtask_id: str,
source_package_path: str,
Expand Down Expand Up @@ -89,6 +92,7 @@ def blender_verification_request(

@shared_task
@log_task_errors
@transaction.atomic(using='storage')
def upload_acknowledged(
subtask_id: str,
source_file_size: str,
Expand Down
1 change: 1 addition & 0 deletions concent_api/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

@shared_task
@log_task_errors
@transaction.atomic(using='control')
def upload_finished(subtask_id: str):
try:
subtask = Subtask.objects.get(subtask_id=subtask_id)
Expand Down

0 comments on commit 46a7605

Please sign in to comment.