Remove rate limit auto-retry

This commit is contained in:
Noi 2022-03-30 21:51:44 -07:00
parent 7ee4ff7ad1
commit 400cc4bfbd
2 changed files with 1 additions and 3 deletions

View file

@ -139,10 +139,8 @@ class BirthdayRoleUpdate : BackgroundService {
if (!toApply.Contains(user.Id)) removals.Add(user); if (!toApply.Contains(user.Id)) removals.Add(user);
else no_ops.Add(user.Id); else no_ops.Add(user.Id);
} }
int removalAllowance = 15; // Limit removals per run, to not get continuously stuck on rate limits in misconfigured servers
foreach (var user in removals) { foreach (var user in removals) {
await user.RemoveRoleAsync(r); await user.RemoveRoleAsync(r);
if (--removalAllowance == 0) break;
} }
foreach (var target in toApply) { foreach (var target in toApply) {

View file

@ -113,7 +113,7 @@ class ShardManager : IDisposable {
ShardId = shardId, ShardId = shardId,
TotalShards = Config.ShardTotal, TotalShards = Config.ShardTotal,
LogLevel = LogSeverity.Info, LogLevel = LogSeverity.Info,
DefaultRetryMode = RetryMode.AlwaysRetry, DefaultRetryMode = RetryMode.Retry502 | RetryMode.RetryTimeouts,
GatewayIntents = GatewayIntents.Guilds | GatewayIntents.GuildMembers | GatewayIntents.GuildMessages GatewayIntents = GatewayIntents.Guilds | GatewayIntents.GuildMembers | GatewayIntents.GuildMessages
}; };
var services = new ServiceCollection() var services = new ServiceCollection()