Remove webhook rate limit cache
The move to DSharpPlus makes it unnecessary, as D#+ can actually do webhook invocations on its own.
This commit is contained in:
@@ -102,21 +102,17 @@ namespace PluralKit.Bot
|
||||
{
|
||||
private ILifetimeScope _services;
|
||||
private DiscordShardedClient _client;
|
||||
private Timer _updateTimer;
|
||||
private IMetrics _metrics;
|
||||
private PeriodicStatCollector _collector;
|
||||
private ILogger _logger;
|
||||
private WebhookRateLimitService _webhookRateLimit;
|
||||
private int _periodicUpdateCount;
|
||||
private Task _periodicWorker;
|
||||
|
||||
public Bot(ILifetimeScope services, DiscordShardedClient client, IMetrics metrics, PeriodicStatCollector collector, ILogger logger, WebhookRateLimitService webhookRateLimit)
|
||||
public Bot(ILifetimeScope services, DiscordShardedClient client, IMetrics metrics, PeriodicStatCollector collector, ILogger logger)
|
||||
{
|
||||
_services = services;
|
||||
_client = client;
|
||||
_metrics = metrics;
|
||||
_collector = collector;
|
||||
_webhookRateLimit = webhookRateLimit;
|
||||
_logger = logger.ForContext<Bot>();
|
||||
}
|
||||
|
||||
@@ -182,12 +178,6 @@ namespace PluralKit.Bot
|
||||
}
|
||||
catch (WebSocketException) { }
|
||||
|
||||
// Run webhook rate limit GC every 10 minutes
|
||||
if (_periodicUpdateCount++ % 10 == 0)
|
||||
{
|
||||
var _ = Task.Run(() => _webhookRateLimit.GarbageCollect());
|
||||
}
|
||||
|
||||
await _collector.CollectStats();
|
||||
|
||||
_logger.Information("Submitted metrics to backend");
|
||||
|
Reference in New Issue
Block a user