diff --git a/modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy b/modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy index a1d48e5316..4366fbba4f 100644 --- a/modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy @@ -828,7 +828,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 {