1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-26 22:56:23 -04:00

New: Retry on failed downloads of torrent and nzb files

This commit is contained in:
Bogdan
2023-12-09 17:58:57 +02:00
committed by Mark McDowall
parent 16d60a6586
commit bc20ef73bd
4 changed files with 43 additions and 6 deletions
@@ -139,7 +139,9 @@ namespace NzbDrone.Core.Download
request.Headers.Accept = "application/x-bittorrent";
request.AllowAutoRedirect = false;
var response = await _httpClient.GetAsync(request);
var response = await RetryStrategy
.ExecuteAsync(static async (state, _) => await state._httpClient.GetAsync(state.request), (_httpClient, request))
.ConfigureAwait(false);
if (response.StatusCode == HttpStatusCode.MovedPermanently ||
response.StatusCode == HttpStatusCode.Found ||