diff --git a/CHANGES.rst b/CHANGES.rst index e5f33f8..6da8353 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,7 @@ Changes Version 0.9.1 (UNRELEASED) -------------------------- +- Fixes the total job count reported to workflow controller by excluding jobs restored from the workspace and not executed by Snakemake. - Fixes an issue where some workflows would be stuck waiting for already-finished jobs. Version 0.9.0 (2023-01-19) diff --git a/reana_workflow_engine_snakemake/utils.py b/reana_workflow_engine_snakemake/utils.py index b83c909..f0130c2 100644 --- a/reana_workflow_engine_snakemake/utils.py +++ b/reana_workflow_engine_snakemake/utils.py @@ -17,7 +17,9 @@ def publish_workflow_start( workflow_uuid: str, publisher: WorkflowStatusPublisher, job: Job ): """Publish to MQ the start of the workflow.""" - job_count = len([rule for rule in job.dag.rules if not rule.norun]) + job_count = len( + [j for j in (job.dag._needrun | job.dag._finished) if not j.rule.norun] + ) total_jobs = {"total": job_count, "job_ids": []} status_running = 1 publisher.publish_workflow_status(