From 9ad390b437fed1b620c1b7ff1763536218ac2ff2 Mon Sep 17 00:00:00 2001 From: Rob Syme Date: Thu, 2 Jan 2025 15:48:17 -0500 Subject: [PATCH] Only close the cache db if it is not null. This fixes a bug where the cache db is not closed if an exception occurs when opening it. This unhandled exception will cause Nextflow to fail and prevent the Global.cleanUp() from being called. --- modules/nextflow/src/main/groovy/nextflow/Session.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nextflow/src/main/groovy/nextflow/Session.groovy b/modules/nextflow/src/main/groovy/nextflow/Session.groovy index f394245259..ad29ad3538 100644 --- a/modules/nextflow/src/main/groovy/nextflow/Session.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/Session.groovy @@ -1226,7 +1226,7 @@ class Session implements ISession { log.warn("Failed to cleanup work dir: ${workDir.toUriString()}") } finally { - db.close() + db?.close() } }