提交 a8e6a919 编写于 作者: I isidor

fixes #54397

上级 807efa6e
......@@ -718,16 +718,20 @@ export class DebugService implements IDebugService {
// task is already running - nothing to do.
return Promise.resolve(null);
}
once(TaskEventKind.Active, this.taskService.onDidStateChange)((taskEvent) => {
once(TaskEventKind.Active, this.taskService.onDidStateChange)(taskEvent => {
// Task is active, so everything seems to be fine, no need to prompt after 10 seconds
// Use case being a slow running task should not be prompted even though it takes more than 10 seconds
taskStarted = true;
if (taskEvent.taskId === task._id) {
taskStarted = true;
}
});
const taskPromise = this.taskService.run(task);
if (task.isBackground) {
return new Promise((c, e) => once(TaskEventKind.Inactive, this.taskService.onDidStateChange)(() => {
taskStarted = true;
c(null);
return new Promise((c, e) => once(TaskEventKind.Inactive, this.taskService.onDidStateChange)(taskEvent => {
if (taskEvent.taskId === task._id) {
taskStarted = true;
c(null);
}
}));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册