Auto-prune of full helper roles #495
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Closes #483. This is a somewhat urgent mitigation due to a technical limitation. Our helper-role system breaks once a helper role has more than 100 users (usually the JAVA helper role).
This mitigates the problem by automatically removing some users from helper roles.
Details
Roles are pruned once they go beyond
95
users (the hard limit is100
). It will then attempt to prune10
random users who fulfill:Users are send a DM to inform them about what happened:
The routine also logs on
INFO
level who got pruned, so we can always double check in the logs. It will also tell us onWARN
level if a role is, despite auto-pruning, approaching or even going beyond the limit. So that we can start to prune manually.Latter warnings are also forwarded to the
#mod_audit_log
channel, so that we really do not miss it:Other stuff
This PR also addresses two unrelated things:
log4j2.xml
BotCore#onReady
is not always triggered because the core is added too late to JDA