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
This commit is contained in:
parent
5161533a6f
commit
602cfcb789
@ -22,7 +22,7 @@ import celery
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from celery import group, chord
|
from celery import group
|
||||||
from mediagoblin import mg_globals as mgg
|
from mediagoblin import mg_globals as mgg
|
||||||
from mediagoblin.processing import (
|
from mediagoblin.processing import (
|
||||||
FilenameBuilder, BaseProcessingFail,
|
FilenameBuilder, BaseProcessingFail,
|
||||||
@ -585,7 +585,4 @@ class VideoProcessingManager(ProcessingManager):
|
|||||||
cleanup_task = processing_cleanup.signature(args=(entry.id,),
|
cleanup_task = processing_cleanup.signature(args=(entry.id,),
|
||||||
queue='default', immutable=True)
|
queue='default', immutable=True)
|
||||||
|
|
||||||
chord(transcoding_tasks)(cleanup_task)
|
return (transcoding_tasks, cleanup_task)
|
||||||
|
|
||||||
# Not sure what to return since we are scheduling the task here itself
|
|
||||||
return 1
|
|
||||||
|
@ -20,6 +20,8 @@ from os.path import splitext
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
from celery import chord
|
||||||
|
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
from werkzeug.datastructures import FileStorage
|
from werkzeug.datastructures import FileStorage
|
||||||
|
|
||||||
@ -271,6 +273,8 @@ def run_process_media(entry, feed_url=None,
|
|||||||
ProcessMedia().apply_async(
|
ProcessMedia().apply_async(
|
||||||
[entry.id, feed_url, reprocess_action, reprocess_info], {},
|
[entry.id, feed_url, reprocess_action, reprocess_info], {},
|
||||||
task_id=entry.queued_task_id)
|
task_id=entry.queued_task_id)
|
||||||
|
else:
|
||||||
|
chord(wf[0])(wf[1])
|
||||||
except BaseException as exc:
|
except BaseException as exc:
|
||||||
# The purpose of this section is because when running in "lazy"
|
# The purpose of this section is because when running in "lazy"
|
||||||
# or always-eager-with-exceptions-propagated celery mode that
|
# or always-eager-with-exceptions-propagated celery mode that
|
||||||
|
Loading…
x
Reference in New Issue
Block a user