Skip to content

Commit

Permalink
Remove unused aegisCache map
Browse files Browse the repository at this point in the history
Operations having to do with issuing nuke punishments and undoing said
punishments rely on the `singleUserAegisCache` map and the
`nukedPhrases` array. It appears the `aegisCache` offers no utility, so
it can be removed.
  • Loading branch information
11k committed Oct 2, 2024
1 parent b31d55a commit 260ee3b
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/services/punishment-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class PunishmentCache {
* @type {Object.<string, PunishedViewer>}
*/
this.punishedViewersMap = {};
this.aegisCache = [];
this.singleUserAegisCache = {};
this.timeToLive = config.timeToLiveSeconds || 1800;
this.tombStoneInterval = config.tomeStoneIntervalMilliseconds || 120000;
Expand Down Expand Up @@ -60,7 +59,6 @@ class PunishmentCache {
}

addNukeToCache(userList, nukedPhrase, duration, isMegaNuke) {
this.aegisCache.push({ nukedPhrase, userList });
this.nukedPhrases.push({ duration, phrase: nukedPhrase, isMegaNuke });
userList.forEach((user) => {
this.addUserToAegisCache(user, duration, nukedPhrase);
Expand All @@ -82,14 +80,6 @@ class PunishmentCache {
nukedPhrase.phrase instanceof RegExp ? nukedPhrase.phrase.toString() : nukedPhrase.phrase;
return curPhrase.toLowerCase() !== nuke.toLowerCase();
});

this.aegisCache = this.aegisCache.filter((nukedPhrase) => {
const curPhrase =
nukedPhrase.nukedPhrase instanceof RegExp
? nukedPhrase.nukedPhrase.toString()
: nukedPhrase.nukedPhrase;
return curPhrase.toLowerCase() !== nuke.toLowerCase();
});
}

cleanseNukes() {
Expand Down

0 comments on commit 260ee3b

Please sign in to comment.