mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Tweak RegExpRunner timeouts
This commit is contained in:
parent
d3d51a5308
commit
edd78fc9c6
1 changed files with 3 additions and 3 deletions
|
@ -23,9 +23,9 @@ export function allowTimeout(err: RegExpTimeoutError | Error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regex timeout starts at a higher value while the bot loads initially, and gets lowered afterwards
|
// Regex timeout starts at a higher value while the bot loads initially, and gets lowered afterwards
|
||||||
const INITIAL_REGEX_TIMEOUT = 1000; // ms
|
const INITIAL_REGEX_TIMEOUT = 5 * SECONDS;
|
||||||
const INITIAL_REGEX_TIMEOUT_DURATION = 30 * SECONDS;
|
const INITIAL_REGEX_TIMEOUT_DURATION = 30 * SECONDS;
|
||||||
const FINAL_REGEX_TIMEOUT = 750; // ms
|
const FINAL_REGEX_TIMEOUT = 5 * SECONDS;
|
||||||
|
|
||||||
const regexTimeoutUpgradePromise = new Promise(resolve => setTimeout(resolve, INITIAL_REGEX_TIMEOUT_DURATION));
|
const regexTimeoutUpgradePromise = new Promise(resolve => setTimeout(resolve, INITIAL_REGEX_TIMEOUT_DURATION));
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ let newWorkerTimeout = INITIAL_REGEX_TIMEOUT;
|
||||||
regexTimeoutUpgradePromise.then(() => (newWorkerTimeout = FINAL_REGEX_TIMEOUT));
|
regexTimeoutUpgradePromise.then(() => (newWorkerTimeout = FINAL_REGEX_TIMEOUT));
|
||||||
|
|
||||||
const REGEX_FAIL_TO_COOLDOWN_COUNT = 5; // If a regex times out this many times...
|
const REGEX_FAIL_TO_COOLDOWN_COUNT = 5; // If a regex times out this many times...
|
||||||
const REGEX_FAIL_DECAY_TIME = 20 * SECONDS; // ...in this interval...
|
const REGEX_FAIL_DECAY_TIME = 2 * MINUTES; // ...in this interval...
|
||||||
const REGEX_FAIL_COOLDOWN = 2 * MINUTES + 30 * SECONDS; // ...it goes on cooldown for this long
|
const REGEX_FAIL_COOLDOWN = 2 * MINUTES + 30 * SECONDS; // ...it goes on cooldown for this long
|
||||||
|
|
||||||
export interface RegExpRunner {
|
export interface RegExpRunner {
|
||||||
|
|
Loading…
Add table
Reference in a new issue