Skip to content

Commit

Permalink
Revert "Fix the cleanup of local secret file" (#5697) [ci fast]
Browse files Browse the repository at this point in the history
This reverts commit e28537c.
  • Loading branch information
pditommaso authored Jan 23, 2025
1 parent 0f66a42 commit 55f25b3
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import nextflow.Const
import nextflow.SysEnv
import nextflow.exception.AbortOperationException
import nextflow.exception.ProcessUnrecoverableException
import nextflow.util.CacheHelper
import nextflow.util.Escape
/**
* Implements a secrets store that saves secrets into a JSON file save into the
Expand Down Expand Up @@ -197,13 +198,11 @@ class LocalSecretsProvider implements SecretsProvider, Closeable {
if( !secretsMap )
return null

final name = ".nf-${UUID.randomUUID().toString()}.secrets"
final name = ".nf-${CacheHelper.hasher(secretsMap.values()).hash()}.secrets"
final path = storeFile.parent.resolve(name)
if( path.exists() ) {
// make sure the file can only be accessed by the owner user
path.setPermissions(ONLY_OWNER_PERMS)
// remove it on completion
path.toFile().deleteOnExit()
return path
}

Expand All @@ -216,9 +215,6 @@ class LocalSecretsProvider implements SecretsProvider, Closeable {
// make sure the file can only be accessed by the owner user
path.setPermissions(ONLY_OWNER_PERMS)
path.text = result
// remove it on completion
path.toFile().deleteOnExit()
// return the temp path
return path
}
}

0 comments on commit 55f25b3

Please sign in to comment.