Skip to content

Commit

Permalink
Added check for session success
Browse files Browse the repository at this point in the history
  • Loading branch information
apetkau committed Dec 14, 2023
1 parent 51da6c1 commit 7071cff
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class IridaNextObserver implements TraceObserver {
private String samplesMetadataId
private Path iridaNextOutputPath
private Boolean outputFileOverwrite
private Session session

public IridaNextObserver() {
pathMatchers = [:]
Expand All @@ -84,6 +85,8 @@ class IridaNextObserver implements TraceObserver {

@Override
void onFlowCreate(Session session) {
this.session = session

iridaNextOutputPath = session.config.navigate('iridanext.output.path') as Path
if (iridaNextOutputPath != null) {
iridaNextOutputPath = Nextflow.file(iridaNextOutputPath) as Path
Expand Down Expand Up @@ -164,6 +167,9 @@ class IridaNextObserver implements TraceObserver {

@Override
void onFlowComplete() {
if (!session.isSuccess())
return

// Generate files section
// Some of this code derived from https://github.com/nextflow-io/nf-prov/blob/master/plugins/nf-prov
tasks.each { task ->
Expand Down

0 comments on commit 7071cff

Please sign in to comment.