From 432ed8cbcf122f6ac47d2bb15f22ab41a1848175 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 19 Dec 2020 03:14:49 +0200 Subject: [PATCH] Only log disabled regexes to stderr, not every timeout --- backend/src/plugins/Logs/LogsPlugin.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/backend/src/plugins/Logs/LogsPlugin.ts b/backend/src/plugins/Logs/LogsPlugin.ts index f643275c..13a6fb16 100644 --- a/backend/src/plugins/Logs/LogsPlugin.ts +++ b/backend/src/plugins/Logs/LogsPlugin.ts @@ -106,10 +106,8 @@ export const LogsPlugin = zeppelinGuildPlugin()("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()("logs", { "```", }); }; - state.regexRunner.on("timeout", state.regexRunnerTimeoutListener); state.regexRunner.on("repeatedTimeout", state.regexRunnerRepeatedTimeoutListener); },