Skip to content

Commit

Permalink
Remove toList() channel operation from inside onComplete block
Browse files Browse the repository at this point in the history
This PR resolves an important bug in the nf-core template, whereby all workflows will hang if the --email parameter is supplied.

The onComplete block will hang if there are any (queue) channel operations inside the block. All values in the onComplete block must be resolved to single values or value channels _before_ the onComplete block starts.

The async channels are not available inside onComplete, so calling the toList() operation will hang forever as the async queue channel will never be completed.
  • Loading branch information
robsyme committed Dec 2, 2024
1 parent 1dd8ea0 commit abb0fa2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
- Update codecov/codecov-action action to v5 ([#3283](https://github.com/nf-core/tools/pull/3283))
- Update python:3.12-slim Docker digest to 2a6386a ([#3284](https://github.com/nf-core/tools/pull/3284))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.8.0 ([#3299](https://github.com/nf-core/tools/pull/3299))
- Remove toList() channel operation from inside onComplete block ([#3304](https://github.com/nf-core/tools/pull/3304))

## [v3.0.2 - Titanium Tapir Patch](https://github.com/nf-core/tools/releases/tag/3.0.2) - [2024-10-11]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ workflow PIPELINE_COMPLETION {
summary_params = [:]
{%- endif %}

{%- if multiqc %}
def multiqc_reports = multiqc_report.toList()
{%- endif %}

//
// Completion email and summary
//
Expand All @@ -153,7 +157,7 @@ workflow PIPELINE_COMPLETION {
plaintext_email,
outdir,
monochrome_logs,
{% if multiqc %}multiqc_report.toList(){% else %}[]{% endif %}
{% if multiqc %}multiqc_reports.getVal(),{% else %}[]{% endif %}
)
}
{%- endif %}
Expand Down

0 comments on commit abb0fa2

Please sign in to comment.