From e14fc998b3ae23c053eb3963e82e7d6846a5af4e Mon Sep 17 00:00:00 2001 From: Paolo Di Tommaso Date: Sun, 19 Jan 2025 22:25:04 +0100 Subject: [PATCH] Prevent the use existing work dir (#5682) [ci fast] Signed-off-by: Paolo Di Tommaso --- .../src/main/groovy/nextflow/processor/TaskProcessor.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy b/modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy index 4b5fbf2791..f17e905f4e 100644 --- a/modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy @@ -830,7 +830,11 @@ class TaskProcessor { try { if( resumeDir != workDir ) exists = workDir.exists() - if( !exists && !workDir.mkdirs() ) + if( exists ) { + tries++ + continue + } + else if( !workDir.mkdirs() ) throw new IOException("Unable to create directory=$workDir -- check file system permissions") } finally {