-
Notifications
You must be signed in to change notification settings - Fork 2
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
Inefficient guildInfo updating #5
Comments
A picture of how long an update takes and here's what it consists of: const messagesToday = await database.getMessageCount(mainServer)
const memberCount = await discordUtility.getMemberCount(mainServer)
const membersOnline = await discordUtility.getOnlineCount(mainServer)
const config = await database.getDataCollectionConfig(mainServer)
const boostStatus = await discordUtility.getBoostStatus(mainServer, config?.allowed ?? [])
const codingLeaderboard = await getCodingLeaderboard()
const messagesLeaderboard = await getMessagesLeaderboard() |
- Use cache in getUserById, - Remove useless ESLint comments - Gracefully error in updateGuildInfoCache
There should now be a cache for user date in |
The code should probably also take advantage of parallel tasks with |
A very good point. |
I implemented that here |
Should we consider this issue closed @ahnl? |
I guess it's because of getMessagesLeaderboard() function, which uses discordUtility.getUserById() function to translate user id to username. The latter function fetches 5 users (number of users displayed on the leaderboard) every 5 seconds (refresh rate) from Discord API seemingly without cache.
Needs investigating.
The text was updated successfully, but these errors were encountered: