counters: apply decays every 5min
This commit is contained in:
parent
a93db7f417
commit
352a8066e5
1 changed files with 2 additions and 1 deletions
|
@ -16,6 +16,7 @@ import { validateCondition } from "./functions/validateCondition";
|
||||||
import { StrictValidationError } from "../../validatorUtils";
|
import { StrictValidationError } from "../../validatorUtils";
|
||||||
|
|
||||||
const MAX_COUNTERS = 5;
|
const MAX_COUNTERS = 5;
|
||||||
|
const DECAY_APPLY_INTERVAL = 5 * MINUTES;
|
||||||
|
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
config: {
|
config: {
|
||||||
|
@ -99,7 +100,7 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()("counter
|
||||||
pluginData.state.decayTimers.push(
|
pluginData.state.decayTimers.push(
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
decayCounter(pluginData, counterName, decayPeriodMs, decay.amount);
|
decayCounter(pluginData, counterName, decayPeriodMs, decay.amount);
|
||||||
}, 10 * SECONDS),
|
}, DECAY_APPLY_INTERVAL),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue