Don't die on timeout on fetching plugins
Summary: The error below was uncaught, showing up in our error monitoring, however, since it is a transient problem (probably an app not responding, too slow in startup, paused in a debuggger, emu being slow, whatever, this isn't actionable from our side, so lowered to warning Reviewed By: lblasa Differential Revision: D44717738 fbshipit-source-id: aefd5e58b4953f563ed155f7a252c130aaafe7ab
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cd7a6bfc40
commit
d19fcb19a8
@@ -126,17 +126,19 @@ export default abstract class AbstractClient extends EventEmitter {
|
|||||||
|
|
||||||
// get the supported plugins
|
// get the supported plugins
|
||||||
protected async loadPlugins(_phase: 'init' | 'refresh'): Promise<Plugins> {
|
protected async loadPlugins(_phase: 'init' | 'refresh'): Promise<Plugins> {
|
||||||
const {plugins} = await timeout(
|
let response;
|
||||||
30 * 1000,
|
try {
|
||||||
this.rawCall<{plugins: Plugins}>('getPlugins', false),
|
response = await timeout(
|
||||||
'Fetch plugin timeout',
|
30 * 1000,
|
||||||
).catch((e) => {
|
this.rawCall<{plugins: Plugins}>('getPlugins', false),
|
||||||
console.warn('Fetch plugin timeout for ' + this.id);
|
'Fetch plugin timeout. Unresponsive client?',
|
||||||
throw e;
|
);
|
||||||
});
|
} catch (e) {
|
||||||
this.plugins = new Set(plugins);
|
console.warn('[conn] Fetch plugin error', e);
|
||||||
console.info('AbstractClient.loadPlugins', this.query, plugins);
|
}
|
||||||
return plugins;
|
this.plugins = new Set(response?.plugins ?? []);
|
||||||
|
console.info('AbstractClient.loadPlugins', this.query, [...this.plugins]);
|
||||||
|
return this.plugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected loadPlugin(
|
protected loadPlugin(
|
||||||
|
|||||||
Reference in New Issue
Block a user