File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
plugins/nf-tower/src/main/io/seqera/tower/plugin Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ class LogsCheckpoint implements TraceObserverV2 {
4040 private Thread thread
4141 private Duration interval
4242 private LogsHandler handler
43- private volatile boolean terminated
4443
4544 @Override
4645 void onFlowCreate (Session session ) {
@@ -57,23 +56,21 @@ class LogsCheckpoint implements TraceObserverV2 {
5756
5857 @Override
5958 void onFlowComplete () {
60- this . terminated = true
59+ thread . interrupt()
6160 thread. join()
6261 }
6362
6463 @Override
6564 void onFlowError (TaskEvent event ) {
66- this . terminated = true
65+ thread . interrupt()
6766 thread. join()
6867 }
6968
7069 protected void run () {
7170 log. debug " Starting logs checkpoint thread - interval: ${ interval} "
7271 try {
73- while ( ! terminated && ! Thread . currentThread(). isInterrupted() ) {
74- // just wait the declared delay
72+ while ( ! Thread . currentThread(). isInterrupted() ) {
7573 await(interval)
76- // checkpoint the logs
7774 handler. saveFiles()
7875 }
7976 }
@@ -87,7 +84,7 @@ class LogsCheckpoint implements TraceObserverV2 {
8784 Thread . sleep(interval. toMillis())
8885 }
8986 catch (InterruptedException e) {
90- log. trace " Interrupted logs checkpoint thread"
87+ log. debug " Interrupted logs checkpoint thread"
9188 Thread . currentThread(). interrupt()
9289 }
9390 }
You can’t perform that action at this time.
0 commit comments