Skip to content

Commit 031de2d

Browse files
committed
Fix admin client retry count (off by one)
Previously, given 1 retry, it would call tryToReconnectStream(1), then tryToReconnectStream(0), and then stop - that's clearly two retries. The total number of retries is also boosted here, which should result in a retry time that is still roughly the same as previous releases by default.
1 parent 3c53452 commit 031de2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/client/admin-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export class AdminClient<Plugins extends { [key: string]: AdminPlugin<any, any>
222222
this.debug = !!options.debug;
223223
this.adminClientOptions = _.defaults(options, {
224224
adminServerUrl: `http://localhost:${DEFAULT_ADMIN_SERVER_PORT}`,
225-
adminStreamReconnectAttempts: 8
225+
adminStreamReconnectAttempts: 10
226226
});
227227
}
228228

@@ -287,7 +287,7 @@ export class AdminClient<Plugins extends { [key: string]: AdminPlugin<any, any>
287287
private async tryToReconnectStream(
288288
adminSessionBaseUrl: string,
289289
targetStream: Duplex,
290-
retries = this.adminClientOptions.adminStreamReconnectAttempts
290+
retries = this.adminClientOptions.adminStreamReconnectAttempts - 1
291291
) {
292292
this.emit('stream-reconnecting');
293293

0 commit comments

Comments
 (0)