Skip to content

Optimize auto prune routine #1208

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

SquidXTV
Copy link
Member

@SquidXTV SquidXTV commented Dec 3, 2024

About

In order to keep helper roles below 250 users, we have a routine that removes a role from a more inactive user.
The old implementation used Guild#findMembersWithRoles to filter for them, which surprisingly requests all
members first and does the filtering on the client. This happens for each role (about 17). So we basically query the same
content multiple times. The new implementation requests all members beforehand and then reusing it to prune roles if needed.

This is related to the issue about a TimeoutException on the member chunk requests when requesting all members. This doesn't mean it is going to fix that issue, but it is still an optimization.

@SquidXTV SquidXTV requested a review from a team as a code owner December 3, 2024 20:16
@SquidXTV SquidXTV changed the title Optimize auto prune routine to not spam requests for all users Optimize auto prune routine Dec 3, 2024
Copy link

sonarqubecloud bot commented Dec 3, 2024

Copy link
Member

@Zabuzard Zabuzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the logic to fallback on the previous behavior or similar when loading fails?

I want to prevent that when "loading all users" fails for whatever reason that this means it fails for all categories.

Currently, if I get this right, when there is a problem with one category it will still attempt it for the other categories individually.

@SquidXTV
Copy link
Member Author

SquidXTV commented May 8, 2025

Can you change the logic to fallback on the previous behavior or similar when loading fails?

I want to prevent that when "loading all users" fails for whatever reason that this means it fails for all categories.

Currently, if I get this right, when there is a problem with one category it will still attempt it for the other categories individually.

You sure that this is needed?
Yeah, it might be possible to fail loading all users, but I don't see how using the current, old, bad code as a fallback makes sense.

@SquidXTV SquidXTV force-pushed the feature/improve-prune-routine branch from 2133a8e to cea6143 Compare May 8, 2025 22:31
Copy link

sonarqubecloud bot commented May 8, 2025

@Zabuzard Zabuzard added bug Something isn't working priority: normal labels May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants