提交 26355789 编写于 作者: A Andre Weinand

timeout for provideDebugAdapterTracker; fixes #59408

上级 ec8eb95d
...@@ -611,11 +611,22 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape { ...@@ -611,11 +611,22 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
.filter(pair => pair.provider.provideDebugAdapterTracker && (pair.type === type || pair.type === '*')) .filter(pair => pair.provider.provideDebugAdapterTracker && (pair.type === type || pair.type === '*'))
.map(pair => asThenable(() => pair.provider.provideDebugAdapterTracker(session, folder, config, CancellationToken.None)).then(p => p).catch(err => null)); .map(pair => asThenable(() => pair.provider.provideDebugAdapterTracker(session, folder, config, CancellationToken.None)).then(p => p).catch(err => null));
return Promise.all(promises).then(trackers => { return Promise.race([
trackers = trackers.filter(t => t); // filter null Promise.all(promises).then(trackers => {
if (trackers.length > 0) { trackers = trackers.filter(t => t); // filter null
return new MultiTracker(trackers); if (trackers.length > 0) {
} return new MultiTracker(trackers);
}
return undefined;
}),
new Promise((resolve, reject) => {
const timeout = setTimeout(() => {
clearTimeout(timeout);
reject(new Error('timeout'));
}, 1000);
})
]).catch(err => {
// ignore errors
return undefined; return undefined;
}); });
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册