From 602cfcb78916ac54bb415d9c2023124b6f3ad5b6 Mon Sep 17 00:00:00 2001 From: vijeth-aradhya Date: Wed, 21 Jun 2017 10:00:56 +0530 Subject: Use tuple as default return type of workflow() If None, then schedule the old Celery call, else the format is group and a single task in the tuple. Hence, Celery chord would be ideal to use. Closes #4 --- mediagoblin/submit/lib.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mediagoblin/submit/lib.py') diff --git a/mediagoblin/submit/lib.py b/mediagoblin/submit/lib.py index b228dbd1..9ec96923 100644 --- a/mediagoblin/submit/lib.py +++ b/mediagoblin/submit/lib.py @@ -20,6 +20,8 @@ from os.path import splitext import six +from celery import chord + from werkzeug.utils import secure_filename from werkzeug.datastructures import FileStorage @@ -271,6 +273,8 @@ def run_process_media(entry, feed_url=None, ProcessMedia().apply_async( [entry.id, feed_url, reprocess_action, reprocess_info], {}, task_id=entry.queued_task_id) + else: + chord(wf[0])(wf[1]) except BaseException as exc: # The purpose of this section is because when running in "lazy" # or always-eager-with-exceptions-propagated celery mode that -- cgit v1.2.3