mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-02 12:47:41 +02:00
Desktop: Disable plugin throttling for now
This commit is contained in:
parent
c668bb0370
commit
6bb0318c2f
@ -1,5 +1,4 @@
|
|||||||
import Logger from '@joplin/lib/Logger';
|
import Logger from '@joplin/lib/Logger';
|
||||||
import time from '@joplin/lib/time';
|
|
||||||
|
|
||||||
const logger = Logger.create('BackOffHandler');
|
const logger = Logger.create('BackOffHandler');
|
||||||
|
|
||||||
@ -52,13 +51,21 @@ export default class BackOffHandler {
|
|||||||
|
|
||||||
this.waitCount_++;
|
this.waitCount_++;
|
||||||
|
|
||||||
|
// For now don't actually apply a backoff and don't abort.
|
||||||
|
|
||||||
logger.warn(`Plugin ${this.pluginId_}: Applying a backoff of ${interval} seconds due to frequent plugin API calls. Consider reducing the number of calls, caching the data, or requesting more data per call. API call was: `, path, args, `[Wait count: ${this.waitCount_}]`);
|
logger.warn(`Plugin ${this.pluginId_}: Applying a backoff of ${interval} seconds due to frequent plugin API calls. Consider reducing the number of calls, caching the data, or requesting more data per call. API call was: `, path, args, `[Wait count: ${this.waitCount_}]`);
|
||||||
|
|
||||||
if (this.waitCount_ > this.maxWaitCount_) throw new Error(`Plugin ${this.pluginId_}: More than ${this.maxWaitCount_} API alls are waiting - aborting. Please consider queuing the API calls in your plugins to reduce the load on the application.`);
|
if (this.waitCount_ > this.maxWaitCount_) logger.error(`Plugin ${this.pluginId_}: More than ${this.maxWaitCount_} API alls are waiting - aborting. Please consider queuing the API calls in your plugins to reduce the load on the application.`);
|
||||||
|
|
||||||
await time.sleep(interval);
|
|
||||||
|
|
||||||
this.waitCount_--;
|
this.waitCount_--;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// if (this.waitCount_ > this.maxWaitCount_) throw new Error(`Plugin ${this.pluginId_}: More than ${this.maxWaitCount_} API alls are waiting - aborting. Please consider queuing the API calls in your plugins to reduce the load on the application.`);
|
||||||
|
|
||||||
|
// await time.sleep(interval);
|
||||||
|
|
||||||
|
// this.waitCount_--;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -160,10 +160,8 @@ export default class PluginRunner extends BasePluginRunner {
|
|||||||
try {
|
try {
|
||||||
await this.backOffHandler(plugin.id).wait(fullPath, debugMappedArgs);
|
await this.backOffHandler(plugin.id).wait(fullPath, debugMappedArgs);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// For now, we don't disable the plugin, but still print the
|
|
||||||
// errors so that any issue can be investigated easily.
|
|
||||||
logger.error(error);
|
logger.error(error);
|
||||||
// return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let result: any = null;
|
let result: any = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user