mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-20 03:40:49 +02:00
Swallow HTTP issues on analytics call
This commit is contained in:
parent
d1949d24e0
commit
0e2d15cb73
1 changed files with 11 additions and 3 deletions
|
|
@ -18,11 +18,12 @@ public class ReleaseAnalyticsService : IHandleAsync<IndexerQueryEvent>
|
|||
private readonly IAnalyticsService _analyticsService;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public ReleaseAnalyticsService(IHttpClient httpClient, IProwlarrCloudRequestBuilder requestBuilder, IAnalyticsService analyticsService)
|
||||
public ReleaseAnalyticsService(IHttpClient httpClient, IProwlarrCloudRequestBuilder requestBuilder, IAnalyticsService analyticsService, Logger logger)
|
||||
{
|
||||
_analyticsService = analyticsService;
|
||||
_requestBuilder = requestBuilder.Releases;
|
||||
_httpClient = httpClient;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void HandleAsync(IndexerQueryEvent message)
|
||||
|
|
@ -43,8 +44,15 @@ public void HandleAsync(IndexerQueryEvent message)
|
|||
PublishDate = x.PublishDate
|
||||
});
|
||||
|
||||
request.SetContent(body.ToJson());
|
||||
_httpClient.Post(request);
|
||||
try
|
||||
{
|
||||
request.SetContent(body.ToJson());
|
||||
_httpClient.Post(request);
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logger.Trace("Analytics push failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue