Skip to content

Commit

Permalink
Fix nf-tower plugin to upload logs when early failures (#5434) [ci fast]
Browse files Browse the repository at this point in the history

Signed-off-by: jorgee <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Co-authored-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
jorgee and pditommaso authored Oct 25, 2024
1 parent ea12846 commit 4222442
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import nextflow.Session
import nextflow.SysEnv
import nextflow.processor.TaskHandler
import nextflow.trace.TraceObserver
import nextflow.trace.TraceRecord
import nextflow.util.Duration
import nextflow.util.Threads
/**
Expand All @@ -47,19 +49,20 @@ class LogsCheckpoint implements TraceObserver {
this.config = session.config
this.handler = new LogsHandler(session, SysEnv.get())
this.interval = config.navigate('tower.logs.checkpoint.interval', defaultInterval()) as Duration
thread = Threads.start('tower-logs-checkpoint', this.&run)
}

private String defaultInterval() {
SysEnv.get('TOWER_LOGS_CHECKPOINT_INTERVAL','90s')
}

@Override
void onFlowBegin() {
thread = Threads.start('tower-logs-checkpoint', this.&run)
void onFlowComplete() {
this.terminated = true
thread.join()
}

@Override
void onFlowComplete() {
void onFlowError(TaskHandler handler, TraceRecord trace){
this.terminated = true
thread.join()
}
Expand Down

0 comments on commit 4222442

Please sign in to comment.