File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
modules/nextflow/src/main/groovy/nextflow Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -1209,10 +1209,8 @@ class Session implements ISession {
1209
1209
if ( aborted || cancelled || error )
1210
1210
return
1211
1211
1212
- CacheDB db = null
1213
- try {
1214
- log. trace " Cleaning-up workdir"
1215
- db = CacheFactory . create(uniqueId, runName). openForRead()
1212
+ log. trace " Cleaning-up workdir"
1213
+ try (CacheDB db = CacheFactory . create(uniqueId, runName). openForRead()) {
1216
1214
db. eachRecord { HashCode hash , TraceRecord record ->
1217
1215
def deleted = db. removeTaskEntry(hash)
1218
1216
if ( deleted ) {
@@ -1223,10 +1221,7 @@ class Session implements ISession {
1223
1221
log. trace " Clean workdir complete"
1224
1222
}
1225
1223
catch ( Exception e ) {
1226
- log. warn(" Failed to cleanup work dir: ${ workDir.toUriString()} " )
1227
- }
1228
- finally {
1229
- db. close()
1224
+ log. warn(" Failed to cleanup work dir: ${ workDir.toUriString()} " , e)
1230
1225
}
1231
1226
}
1232
1227
You can’t perform that action at this time.
0 commit comments