Skip to content

Commit

Permalink
Ensure that the onComplete block doesn't hang.
Browse files Browse the repository at this point in the history
  • Loading branch information
robsyme committed Nov 29, 2024
1 parent c4fb145 commit 4773e58
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
8 changes: 7 additions & 1 deletion subworkflows/local/utils_nfcore_rnaseq_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,16 @@ workflow PIPELINE_COMPLETION {
id, status -> pass_strand_check[id] = status
}

// We need to ensure that the multiqc_report is a value channel (DataflowVariable).
// Queue channels will not be available in the workflow.onComplete block.
def multiqc_reports = multiqc_report.toList()

//
// Completion email and summary
//
workflow.onComplete {
assert multiqc_reports instanceof groovyx.gpars.dataflow.DataflowVariable : "Expected a value channel (DataflowVariable) for multiqc_reports inside workflow.onComplete block."

if (email || email_on_fail) {
completionEmail(
summary_params,
Expand All @@ -128,7 +134,7 @@ workflow PIPELINE_COMPLETION {
plaintext_email,
outdir,
monochrome_logs,
multiqc_report.toList()
multiqc_reports.getVal(),
)
}

Expand Down
40 changes: 19 additions & 21 deletions subworkflows/nf-core/utils_nfcore_pipeline/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4773e58

Please sign in to comment.