Swallow HTTP issues on analytics call

pull/1051/head
Qstick 2 years ago
parent d1949d24e0
commit 0e2d15cb73

@ -18,11 +18,12 @@ namespace NzbDrone.Core.IndexerSearch
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,9 +44,16 @@ namespace NzbDrone.Core.IndexerSearch
PublishDate = x.PublishDate
});
try
{
request.SetContent(body.ToJson());
_httpClient.Post(request);
}
catch
{
_logger.Trace("Analytics push failed");
}
}
}
}
}

Loading…
Cancel
Save