mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
Fix Automod not clearing recent actions, leading to memory leak
This commit is contained in:
parent
83c0ee93ed
commit
a75a551ce5
1 changed files with 3 additions and 0 deletions
|
@ -515,6 +515,8 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
this.automodQueue = new Queue();
|
this.automodQueue = new Queue();
|
||||||
|
|
||||||
this.recentActions = [];
|
this.recentActions = [];
|
||||||
|
this.recentActionClearInterval = setInterval(() => this.clearOldRecentActions(), 1 * MINUTES);
|
||||||
|
|
||||||
this.spamGracePeriods = new Map();
|
this.spamGracePeriods = new Map();
|
||||||
this.spamGracePriodClearInterval = setInterval(() => this.clearExpiredGracePeriods(), 1 * SECONDS);
|
this.spamGracePriodClearInterval = setInterval(() => this.clearExpiredGracePeriods(), 1 * SECONDS);
|
||||||
|
|
||||||
|
@ -544,6 +546,7 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
this.savedMessages.events.off("create", this.onMessageCreateFn);
|
this.savedMessages.events.off("create", this.onMessageCreateFn);
|
||||||
clearInterval(this.recentActionClearInterval);
|
clearInterval(this.recentActionClearInterval);
|
||||||
clearInterval(this.spamGracePriodClearInterval);
|
clearInterval(this.spamGracePriodClearInterval);
|
||||||
|
clearInterval(this.recentNicknameChangesClearInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected evaluateMatchWordsTrigger(trigger: TMatchWordsTrigger, str: string): boolean {
|
protected evaluateMatchWordsTrigger(trigger: TMatchWordsTrigger, str: string): boolean {
|
||||||
|
|
Loading…
Add table
Reference in a new issue