Do sweepers invalidate references to the swept object?

For instance, if my sweeper setup is
{
GuildMemberManager: {
maxSize: 200,
keepOverLimit: (member) => member.id === member.client.user.id
}
}
{
GuildMemberManager: {
maxSize: 200,
keepOverLimit: (member) => member.id === member.client.user.id
}
}
, but I fetch members somewhere else via a guild.members.fetch() call:
export let members = null;
export async doFetchCall(guild) {
const mx = await guild.members.fetch();
members = mx;
}
export let members = null;
export async doFetchCall(guild) {
const mx = await guild.members.fetch();
members = mx;
}
and hold that array in memory for future access, what happens to the member objects when the sweeper triggers? Are they protected and thus the sweeper holds more member objects than the maximum?
2 Replies
d.js toolkit
d.js toolkit8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
piemot
piemotOP8mo ago
(node v20.12.1, discord.js v14.14.1). No stack trace applicable.
Want results from more Discord servers?
Add your server