Skip to content

Commit

Permalink
perf: don’t limit cache, only sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
tippfehlr committed Mar 9, 2024
1 parent ee42ad0 commit 412ba9b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/modules/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@ export const client = new Discord.Client({
makeCache: Options.cacheWithLimits({
...Options.DefaultMakeCacheSettings,
MessageManager: 0,
UserManager: {
maxSize: 25000,
keepOverLimit: user => user.id === user.client.user.id,
},
GuildMemberManager: {
maxSize: 5000,
keepOverLimit: member => member.id === member.client.user.id,
},
PresenceManager: 50000,
// UserManager: {
// maxSize: 25000,
// keepOverLimit: user => user.id === user.client.user.id,
// },
// GuildMemberManager: {
// maxSize: 5000,
// keepOverLimit: member => member.id === member.client.user.id,
// },
// PresenceManager: 50000,
}),
sweepers: {
...Options.DefaultSweeperSettings,
users: {
interval: 30 * 60, // 30 minutes
filter: () => user => user.id !== user.client.user.id, // don’t remove the client’s user
},
presences: {
interval: 30 * 60,
filter: () => () => true, // remove all presences
},
guildMembers: {
interval: 30 * 60,
filter: () => member => member.id !== member.client.user.id,
},
presences: {
interval: 30 * 60,
filter: () => () => true, // remove all presences
},
},
});

Expand Down

0 comments on commit 412ba9b

Please sign in to comment.