3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Only log disabled regexes to stderr, not every timeout

This commit is contained in:
Dragory 2020-12-19 03:14:49 +02:00
parent 81c696d10d
commit 432ed8cbcf
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -106,10 +106,8 @@ export const LogsPlugin = zeppelinGuildPlugin<LogsPluginType>()("logs", {
state.savedMessages.events.on("update", state.onMessageUpdateFn);
state.regexRunner = getRegExpRunner(`guild-${pluginData.guild.id}`);
state.regexRunnerTimeoutListener = (regexSource, timeoutMs) => {
logger.warn(`Heavy regex (${timeoutMs}): ${regexSource}`);
};
state.regexRunnerRepeatedTimeoutListener = (regexSource, timeoutMs, failedTimes) => {
logger.warn(`Disabled heavy regex temporarily: ${regexSource}`);
log(pluginData, LogType.BOT_ALERT, {
body:
`
@ -120,7 +118,6 @@ export const LogsPlugin = zeppelinGuildPlugin<LogsPluginType>()("logs", {
"```",
});
};
state.regexRunner.on("timeout", state.regexRunnerTimeoutListener);
state.regexRunner.on("repeatedTimeout", state.regexRunnerRepeatedTimeoutListener);
},