Skip to content

Commit fff727e

Browse files
fix nit
1 parent 62480fc commit fff727e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/ConfigurationClientManager.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ export class ConfigurationClientManager {
155155
// We need to make sure the scale of the potential memory leak is controllable.
156156
const srvQueryPromise = this.#querySrvTargetHost(host);
157157
// There is no way to check the promise status synchronously, so we need to set the flag through the callback.
158-
srvQueryPromise
159-
.then(() => this.#srvQueryPending = false) // resolved
160-
.catch(() => this.#srvQueryPending = false); // rejected
158+
srvQueryPromise.finally(() => this.#srvQueryPending = false)
161159
// If the srvQueryPromise is rejected before timeout, the error will be caught in the catch block.
162160
// Otherwise, the timeout error will be caught in the catch block and the srvQueryPromise rejection will be ignored.
163161
result = await Promise.race([

0 commit comments

Comments
 (0)