@@ -8,7 +8,7 @@ import { getErrorMessage } from "../pure/helpers-pure";
88 * same time.
99 */
1010export abstract class Discovery < T > extends DisposableObject {
11- private retry = false ;
11+ private restartWhenFinished = false ;
1212 private currentDiscoveryPromise : Promise < void > | undefined ;
1313
1414 constructor ( private readonly name : string ) {
@@ -48,7 +48,7 @@ export abstract class Discovery<T> extends DisposableObject {
4848
4949 if ( this . currentDiscoveryPromise !== undefined ) {
5050 // There's already a discovery operation in progress. Tell it to restart when it's done.
51- this . retry = true ;
51+ this . restartWhenFinished = true ;
5252 } else {
5353 // No discovery in progress, so start one now.
5454 this . currentDiscoveryPromise = this . launchDiscovery ( ) ;
@@ -72,13 +72,13 @@ export abstract class Discovery<T> extends DisposableObject {
7272 results = undefined ;
7373 }
7474
75- if ( this . retry ) {
75+ if ( this . restartWhenFinished ) {
7676 // Another refresh request came in while we were still running a previous discovery
7777 // operation. Since the discovery results we just computed are now stale, we'll launch
7878 // another discovery operation instead of updating.
79- // Note that by doing this inside of `finally`, we will relaunch discovery even if the
80- // initial discovery operation failed.
81- this . retry = false ;
79+ // We want to relaunch discovery regardless of if the initial discovery operation
80+ // succeeded or failed.
81+ this . restartWhenFinished = false ;
8282 await this . launchDiscovery ( ) ;
8383 } else {
8484 this . currentDiscoveryPromise = undefined ;
0 commit comments