do not timeout on faulty async handlers, continue with false to give default handlers chance to run
This commit is contained in:
@@ -484,8 +484,13 @@ export class InputHandler extends Disposable implements IInputHandler {
|
|||||||
private _logSlowResolvingAsync(p: Promise<boolean>): void {
|
private _logSlowResolvingAsync(p: Promise<boolean>): void {
|
||||||
// log a limited warning about an async taking too long
|
// log a limited warning about an async taking too long
|
||||||
if ((this._logService as any)._logLevel <= LogLevel.WARN) {
|
if ((this._logService as any)._logLevel <= LogLevel.WARN) {
|
||||||
Promise.race([p, new Promise((res, rej) => setTimeout(rej, SLOW_ASYNC_LIMIT))])
|
Promise.race([p, new Promise((res, rej) => setTimeout(() => rej('#SLOW_TIMEOUT'), SLOW_ASYNC_LIMIT))])
|
||||||
.catch(() => console.warn(`async parser handler taking longer than ${SLOW_ASYNC_LIMIT} ms`));
|
.catch(err => {
|
||||||
|
if (err !== '#SLOW_TIMEOUT') {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
console.warn(`async parser handler taking longer than ${SLOW_ASYNC_LIMIT} ms`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ export class WriteBuffer {
|
|||||||
// (executed on the same queue, thus properly aligned before continuation happens)
|
// (executed on the same queue, thus properly aligned before continuation happens)
|
||||||
result.catch(err => {
|
result.catch(err => {
|
||||||
qmt(() => {throw err;});
|
qmt(() => {throw err;});
|
||||||
return Promise.resolve(true);
|
return Promise.resolve(false);
|
||||||
}).then(continuation);
|
}).then(continuation);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user