From ab6862bf6aeb10b8e2958b4f4ff13f0d11f95f90 Mon Sep 17 00:00:00 2001 From: Sylvain <35365065+sanderegg@users.noreply.github.com> Date: Mon, 30 Mar 2020 09:49:14 +0200 Subject: [PATCH] fix issue when next_task_nodes is None (#1411) --- .../sidecar/src/simcore_service_sidecar/celery.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/services/sidecar/src/simcore_service_sidecar/celery.py b/services/sidecar/src/simcore_service_sidecar/celery.py index 54075f12339..480a193e0e0 100644 --- a/services/sidecar/src/simcore_service_sidecar/celery.py +++ b/services/sidecar/src/simcore_service_sidecar/celery.py @@ -22,20 +22,20 @@ @app.task(name="comp.task", bind=True) def pipeline(self, user_id: str, project_id: str, node_id: str = None): - next_task_nodes = [] try: next_task_nodes = wrap_async_call( run_sidecar(self.request.id, user_id, project_id, node_id) ) self.update_state(state=states.SUCCESS) + + if next_task_nodes: + for _node_id in next_task_nodes: + _task = app.send_task( + "comp.task", args=(user_id, project_id, _node_id), kwargs={} + ) except Exception: # pylint: disable=broad-except self.update_state(state=states.FAILURE) - log.exception("Uncaught exception") - - for _node_id in next_task_nodes: - _task = app.send_task( - "comp.task", args=(user_id, project_id, _node_id), kwargs={} - ) + log.exception("Uncaught exception") __all__ = ["rabbit_config", "app"]