Fix interceptor memory leaks (#66)
This commit is contained in:
@@ -5,6 +5,7 @@ using Common.Configuration.QueueCleaner;
|
||||
using Domain.Models.Arr;
|
||||
using Domain.Models.Arr.Queue;
|
||||
using Domain.Models.Lidarr;
|
||||
using Infrastructure.Interceptors;
|
||||
using Infrastructure.Verticals.Arr.Interfaces;
|
||||
using Infrastructure.Verticals.ItemStriker;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -15,18 +16,14 @@ namespace Infrastructure.Verticals.Arr;
|
||||
|
||||
public class LidarrClient : ArrClient, ILidarrClient
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public LidarrClient()
|
||||
{
|
||||
}
|
||||
|
||||
public LidarrClient(
|
||||
ILogger<LidarrClient> logger,
|
||||
IHttpClientFactory httpClientFactory,
|
||||
IOptions<LoggingConfig> loggingConfig,
|
||||
IOptions<QueueCleanerConfig> queueCleanerConfig,
|
||||
IStriker striker
|
||||
) : base(logger, httpClientFactory, loggingConfig, queueCleanerConfig, striker)
|
||||
IStriker striker,
|
||||
IDryRunInterceptor dryRunInterceptor
|
||||
) : base(logger, httpClientFactory, loggingConfig, queueCleanerConfig, striker, dryRunInterceptor)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -64,7 +61,8 @@ public class LidarrClient : ArrClient, ILidarrClient
|
||||
|
||||
try
|
||||
{
|
||||
using var _ = await ((LidarrClient)Proxy).SendRequestAsync(request);
|
||||
HttpResponseMessage? response = await _dryRunInterceptor.InterceptAsync<HttpResponseMessage>(SendRequestAsync, request);
|
||||
response?.Dispose();
|
||||
|
||||
_logger.LogInformation("{log}", GetSearchLog(arrInstance.Url, command, true, logContext));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user