Skip to content

Commit d7da017

Browse files
committed
fix: don't try to close secret agent client if it's already closed
1 parent 2c26583 commit d7da017

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app-config-encryption/src/secret-agent.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,11 @@ export async function connectAgent(
112112
closeTimeout = global.setTimeout(() => {
113113
logger.verbose('Closing websocket');
114114

115-
client.close().finally(() => {
116-
logger.verbose('Client was closed');
117-
});
115+
if (!isClosed) {
116+
client.close().finally(() => {
117+
logger.verbose('Client was closed');
118+
});
119+
}
118120
}, closeTimeoutMs);
119121
};
120122

0 commit comments

Comments
 (0)