mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Do not use HttpClient singleton for the InvoiceNotifcationManager
This commit is contained in:
@@ -24,7 +24,7 @@ namespace BTCPayServer.HostedServices
|
|||||||
{
|
{
|
||||||
public class InvoiceNotificationManager : IHostedService
|
public class InvoiceNotificationManager : IHostedService
|
||||||
{
|
{
|
||||||
public static HttpClient _Client = new HttpClient();
|
HttpClient _Client;
|
||||||
|
|
||||||
public class ScheduledJob
|
public class ScheduledJob
|
||||||
{
|
{
|
||||||
@@ -46,6 +46,7 @@ namespace BTCPayServer.HostedServices
|
|||||||
private readonly EmailSenderFactory _EmailSenderFactory;
|
private readonly EmailSenderFactory _EmailSenderFactory;
|
||||||
|
|
||||||
public InvoiceNotificationManager(
|
public InvoiceNotificationManager(
|
||||||
|
IHttpClientFactory httpClientFactory,
|
||||||
IBackgroundJobClient jobClient,
|
IBackgroundJobClient jobClient,
|
||||||
EventAggregator eventAggregator,
|
EventAggregator eventAggregator,
|
||||||
InvoiceRepository invoiceRepository,
|
InvoiceRepository invoiceRepository,
|
||||||
@@ -53,6 +54,7 @@ namespace BTCPayServer.HostedServices
|
|||||||
ILogger<InvoiceNotificationManager> logger,
|
ILogger<InvoiceNotificationManager> logger,
|
||||||
EmailSenderFactory emailSenderFactory)
|
EmailSenderFactory emailSenderFactory)
|
||||||
{
|
{
|
||||||
|
_Client = httpClientFactory.CreateClient();
|
||||||
_JobClient = jobClient;
|
_JobClient = jobClient;
|
||||||
_EventAggregator = eventAggregator;
|
_EventAggregator = eventAggregator;
|
||||||
_InvoiceRepository = invoiceRepository;
|
_InvoiceRepository = invoiceRepository;
|
||||||
|
|||||||
Reference in New Issue
Block a user