Skip to content

Commit

Permalink
refactor(workflow-run-manager): do not update status of jobs (reanahu…
Browse files Browse the repository at this point in the history
…b#559)

Let reana-job-controller update the status of jobs, as this is not a
concern of reana-workflow-controller, which should manage workflows and
not jobs.
  • Loading branch information
mdonadoni committed Jan 29, 2024
1 parent 4b8f539 commit 4f9eb68
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions reana_workflow_controller/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def on_message(self, body, message):
msg = body_dict["message"]
if "progress" in msg:
_update_run_progress(workflow_uuid, msg)
_update_job_progress(workflow_uuid, msg)
# Caching: calculate input hash and store in JobCache
if "caching_info" in msg:
_update_job_cache(msg)
Expand Down Expand Up @@ -226,22 +225,6 @@ def _update_run_progress(workflow_uuid, msg):
Session.add(workflow)


def _update_job_progress(workflow_uuid, msg):
"""Update job progress for jobs in received message."""
for status_name, job_status in PROGRESS_STATUSES:
if status_name in msg["progress"]:
status_progress = msg["progress"][status_name]
for job_id in status_progress["job_ids"]:
try:
uuid.UUID(job_id)
except Exception:
continue
job = Session.query(Job).filter_by(id_=job_id).one_or_none()
if job:
job.workflow_uuid = workflow_uuid
job.status = job_status


def _update_job_cache(msg):
"""Update caching information for finished job."""
cached_job = (
Expand Down

0 comments on commit 4f9eb68

Please sign in to comment.