Skip to content

Commit 56569a6

Browse files
authored
Merge pull request microsoft#187523 from microsoft/merogge/wait
always wait for all supported executions or timeout
2 parents ff81f6c + 492217c commit 56569a6

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
223223

224224
protected _outputChannel: IOutputChannel;
225225
protected readonly _onDidStateChange: Emitter<ITaskEvent>;
226-
private _waitForOneSupportedExecution: Promise<void>;
227226
private _waitForAllSupportedExecutions: Promise<void>;
228227
private _onDidRegisterSupportedExecutions: Emitter<void> = new Emitter();
229228
private _onDidRegisterAllSupportedExecutions: Emitter<void> = new Emitter();
@@ -335,9 +334,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
335334
this._setPersistentTask(e.__task);
336335
}
337336
}));
338-
this._waitForOneSupportedExecution = new Promise(resolve => {
339-
once(this._onDidRegisterSupportedExecutions.event)(() => resolve());
340-
});
341337
this._waitForAllSupportedExecutions = new Promise(resolve => {
342338
once(this._onDidRegisterAllSupportedExecutions.event)(() => resolve());
343339
});
@@ -1957,6 +1953,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
19571953
}
19581954

19591955
private async _getGroupedTasks(filter?: ITaskFilter): Promise<TaskMap> {
1956+
await this._waitForAllSupportedExecutions;
19601957
const type = filter?.type;
19611958
const needsRecentTasksMigration = this._needsRecentTasksMigration();
19621959
await this._activateTaskProviders(filter?.type);
@@ -2209,12 +2206,9 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
22092206
if (!(await this._trust())) {
22102207
return new Map();
22112208
}
2212-
await this._waitForOneSupportedExecution;
2213-
if (runSource === TaskRunSource.Reconnect) {
2214-
await raceTimeout(this._waitForAllSupportedExecutions, 2000, () => {
2215-
this._logService.warn('Timed out waiting for all supported executions for task reconnection');
2216-
});
2217-
}
2209+
await raceTimeout(this._waitForAllSupportedExecutions, 2000, () => {
2210+
this._logService.warn('Timed out waiting for all supported executions');
2211+
});
22182212
await this._whenTaskSystemReady;
22192213
if (this._workspaceTasksPromise) {
22202214
return this._workspaceTasksPromise;

0 commit comments

Comments
 (0)