mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 01:25:39 -05:00
Merge from vscode 4d91d96e5e121b38d33508cdef17868bab255eae
This commit is contained in:
committed by
AzureDataStudio
parent
a971aee5bd
commit
5e7071e466
@@ -53,7 +53,14 @@ export class ExtHostTask extends ExtHostTaskBase {
|
||||
const tTask = (task as types.Task);
|
||||
// We have a preserved ID. So the task didn't change.
|
||||
if (tTask._id !== undefined) {
|
||||
return this._proxy.$executeTask(TaskHandleDTO.from(tTask)).then(value => this.getTaskExecution(value, task));
|
||||
// Always get the task execution first to prevent timing issues when retrieving it later
|
||||
const executionDTO = await this._proxy.$getTaskExecution(TaskHandleDTO.from(tTask));
|
||||
if (executionDTO.task === undefined) {
|
||||
throw new Error('Task from execution DTO is undefined');
|
||||
}
|
||||
const execution = await this.getTaskExecution(executionDTO, task);
|
||||
this._proxy.$executeTask(executionDTO.task).catch(error => { throw new Error(error); });
|
||||
return execution;
|
||||
} else {
|
||||
const dto = TaskDTO.from(task, extension);
|
||||
if (dto === undefined) {
|
||||
@@ -66,8 +73,10 @@ export class ExtHostTask extends ExtHostTaskBase {
|
||||
if (CustomExecutionDTO.is(dto.execution)) {
|
||||
await this.addCustomExecution(dto, task, false);
|
||||
}
|
||||
|
||||
return this._proxy.$executeTask(dto).then(value => this.getTaskExecution(value, task));
|
||||
// Always get the task execution first to prevent timing issues when retrieving it later
|
||||
const execution = await this.getTaskExecution(await this._proxy.$getTaskExecution(dto), task);
|
||||
this._proxy.$executeTask(dto).catch(error => { throw new Error(error); });
|
||||
return execution;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user