mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-15 01:23:53 -07:00
New: Will now temporarily stop using an indexer if the indexer reported an error.
This commit is contained in:
parent
6d046a8df8
commit
f2a70677e4
61 changed files with 994 additions and 173 deletions
21
src/NzbDrone.Common/Http/TooManyRequestsException.cs
Normal file
21
src/NzbDrone.Common/Http/TooManyRequestsException.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Common.Http
|
||||
{
|
||||
public class TooManyRequestsException : HttpException
|
||||
{
|
||||
public TimeSpan RetryAfter { get; private set; }
|
||||
|
||||
public TooManyRequestsException(HttpRequest request, HttpResponse response)
|
||||
: base(request, response)
|
||||
{
|
||||
if (response.Headers.ContainsKey("Retry-After"))
|
||||
{
|
||||
RetryAfter = TimeSpan.FromSeconds(int.Parse(response.Headers["Retry-After"].ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue