Is fetching all threads safe?
I am using private threads as a ticketing system. We have roughly 300 open threads. I currently fetch all the threads on the ready event so they are cached. I am doing this becuase when someone clicks the button to create a ticket, I am searching the titles of the existing tickets to see if they already have one open.
I want to make sure that there is nothing I should be concerned about in doing this, especially in reguards to memory usage. (I have a memory leak somewhere, so I am investigating anything I am not fully sure about).
3 Replies
- 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!For regular usage of djs all channels are cached anyways (in regards to memory, not that it would change anything about threads)
How are you checking if a particular thread is connected to a user anyway? Would it not be better to store that in a db? (such that you dont have to have entire threads cached if you dont need it for anything else)
Regex on thread titles, but yeah as I have thought about I have considered the db route