Skip to content

Commit

Permalink
Remove ping/link logic from member tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Aug 7, 2024
1 parent 2b302e6 commit ecd749a
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/infra/member-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ export class MemberTracker {
entries: member_entry[] = [];
// map from user id -> member entry
id_map: Map<Discord.Snowflake, member_entry> = new Map();
// user id snowflake -> messages with pings
ping_map: Map<string, basic_message_info[]> = new Map();
// user id snowflake -> messages with links
link_map: Map<string, basic_message_info[]> = new Map();
// set of user id snowflakes to prevent race condition
// snowflake -> timestamp of addition to this set
currently_banning: Map<string, number> = new Map();
Expand Down Expand Up @@ -73,15 +69,6 @@ export class MemberTracker {
}
// remove entries before cutoff
this.entries = this.entries.slice(first_in_timeframe);
// -- ping/link maps --
for (const map of [this.ping_map, this.link_map]) {
for (let [k, v] of map) {
v = v.filter(m => now - m.created_timestamp <= LOG_DURATION);
if (v.length == 0) {
this.ping_map.delete(k);
}
}
}
for (const [id, timestamp] of this.currently_banning) {
// Don't keep around for more than 10 minutes, just need to address race condition
if (now - timestamp <= 5 * MINUTE) {
Expand Down

0 comments on commit ecd749a

Please sign in to comment.