Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message Sweep not for manually fetched messages #4599

Closed
SamuelScheit opened this issue Jul 1, 2020 · 2 comments · Fixed by #6110
Closed

Message Sweep not for manually fetched messages #4599

SamuelScheit opened this issue Jul 1, 2020 · 2 comments · Fixed by #6110

Comments

@SamuelScheit
Copy link

I have general conceptional question, no one could help me on the discord server.

You can specify the cache in the client options {messageCacheMaxSize, messageCacheLifetime,messageSweepInterval }
so that ram usage doesn't climb indefinitely.
But if I set it to one message, does my manual fetched messages for e.g. reaction listeners get sweeped?
If yes, add an option to not sweep manually fetched messages.

Thanks!

@navi1995
Copy link

navi1995 commented Jul 5, 2020

I've also run into this issue, and it's not entirely explained in any guide or documentation that when using awaitReactionCollector and the related events that unwanted behaviour can occur when specific client options are set (removing an active message from cache when it should have events on it). It would be nice to be able to set message.stopSweepable() or some manual logic that stops a message from being swept, and after we're done with the message we can set it to be swept. Or otherwise logging a warning to console if the time for a reactionCollector set is longer than the message cache lifetime.

@polypixeldev
Copy link

polypixeldev commented Jul 1, 2021

I also think that something like message.stopSweepable() would be useful to help better manage what you need in the cache. Especially for environments where there isn't a lot of free RAM, the capability to manage your bot's cache is necessary.

Edit: #6013 is making some big changes to being able to customize cache, possibly a way to alternatively implement this could work with this new feature

@SpaceEEC SpaceEEC linked a pull request Jul 16, 2021 that will close this issue
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants