mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-16 10:40:12 +00:00
Add support for Twilight gateway queue
This commit is contained in:
parent
333530d24d
commit
26dc69e5a4
8 changed files with 70 additions and 15 deletions
27
Myriad/Gateway/Limit/TwilightGatewayRatelimiter.cs
Normal file
27
Myriad/Gateway/Limit/TwilightGatewayRatelimiter.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Serilog;
|
||||
|
||||
namespace Myriad.Gateway.Limit
|
||||
{
|
||||
public class TwilightGatewayRatelimiter: IGatewayRatelimiter
|
||||
{
|
||||
private readonly string _url;
|
||||
private readonly ILogger _logger;
|
||||
private readonly HttpClient _httpClient = new();
|
||||
|
||||
public TwilightGatewayRatelimiter(ILogger logger, string url)
|
||||
{
|
||||
_url = url;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task Identify(int shard)
|
||||
{
|
||||
// Literally just request and wait :p
|
||||
_logger.Information("Shard {ShardId}: Requesting identify at gateway queue {GatewayQueueUrl}", shard, _url);
|
||||
await _httpClient.GetAsync(_url);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue