Skip to content

Commit a0e6317

Browse files
Keep all updates of currentDiscoveryPromise in refresh
1 parent d2bb1b8 commit a0e6317

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

extensions/ql-vscode/src/common/discovery.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export abstract class Discovery<T> extends DisposableObject {
5151
this.restartWhenFinished = true;
5252
} else {
5353
// No discovery in progress, so start one now.
54-
this.currentDiscoveryPromise = this.launchDiscovery();
54+
this.currentDiscoveryPromise = this.launchDiscovery().finally(() => {
55+
this.currentDiscoveryPromise = undefined;
56+
});
5557
}
5658
return this.currentDiscoveryPromise;
5759
}
@@ -81,8 +83,6 @@ export abstract class Discovery<T> extends DisposableObject {
8183
this.restartWhenFinished = false;
8284
await this.launchDiscovery();
8385
} else {
84-
this.currentDiscoveryPromise = undefined;
85-
8686
// If the discovery was successful, then update any listeners with the results.
8787
if (results !== undefined) {
8888
this.update(results);

0 commit comments

Comments
 (0)