From 352a8066e5a7734c57731454b51099be2d8e59a8 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 13 Feb 2021 17:44:24 +0200 Subject: [PATCH] counters: apply decays every 5min --- backend/src/plugins/Counters/CountersPlugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/plugins/Counters/CountersPlugin.ts b/backend/src/plugins/Counters/CountersPlugin.ts index 95f06924..eeec9c98 100644 --- a/backend/src/plugins/Counters/CountersPlugin.ts +++ b/backend/src/plugins/Counters/CountersPlugin.ts @@ -16,6 +16,7 @@ import { validateCondition } from "./functions/validateCondition"; import { StrictValidationError } from "../../validatorUtils"; const MAX_COUNTERS = 5; +const DECAY_APPLY_INTERVAL = 5 * MINUTES; const defaultOptions = { config: { @@ -99,7 +100,7 @@ export const CountersPlugin = zeppelinGuildPlugin()("counter pluginData.state.decayTimers.push( setInterval(() => { decayCounter(pluginData, counterName, decayPeriodMs, decay.amount); - }, 10 * SECONDS), + }, DECAY_APPLY_INTERVAL), ); }