mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Reuse a singleton HttpClient for proxying
This commit is contained in:
parent
c70556f5f9
commit
05282fd167
3 changed files with 5 additions and 14 deletions
|
|
@ -25,12 +25,12 @@ namespace PluralKit.Bot
|
|||
private IMetrics _metrics;
|
||||
private HttpClient _client;
|
||||
|
||||
public WebhookExecutorService(IMetrics metrics, WebhookCacheService webhookCache, ILogger logger)
|
||||
public WebhookExecutorService(IMetrics metrics, WebhookCacheService webhookCache, ILogger logger, HttpClient client)
|
||||
{
|
||||
_metrics = metrics;
|
||||
_webhookCache = webhookCache;
|
||||
_client = client;
|
||||
_logger = logger.ForContext<WebhookExecutorService>();
|
||||
_client = new HttpClient {Timeout = TimeSpan.FromSeconds(5)};
|
||||
}
|
||||
|
||||
public async Task<ulong> ExecuteWebhook(ITextChannel channel, string name, string avatarUrl, string content, IReadOnlyCollection<IAttachment> attachments)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue