Simplify recursive function in vault-backend plugin

The update removes a lock inside a recursive function in the vault-backend plugin's vaultApi.ts file. This change helps to prevent potential deadlocks, improving the performance and overall reliability of the code by ensuring it does not get stuck in a locked state.

Signed-off-by: Gabor Galazzo <gabor.galazzo@gmail.com>
This commit is contained in:
Gabor Galazzo
2024-03-17 00:08:37 +01:00
committed by blam
parent d202a258d1
commit 7277fe203d
2 changed files with 8 additions and 5 deletions
@@ -147,11 +147,9 @@ export class VaultClient implements VaultApi {
result.data.keys.map(async secret => {
if (secret.endsWith('/')) {
secrets.push(
...(await this.limit(() =>
this.listSecrets(`${secretPath}/${secret.slice(0, -1)}`, {
secretEngine: mount,
}),
)),
...(await this.listSecrets(`${secretPath}/${secret.slice(0, -1)}`, {
secretEngine: mount,
})),
);
} else {
const vaultUrl =