mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 13:57:11 -04:00
New: Return 429 for Query and Grab Limits
This commit is contained in:
parent
b583ac3a97
commit
0a9bd8287f
1 changed files with 2 additions and 2 deletions
|
@ -131,7 +131,7 @@ namespace NzbDrone.Api.V1.Indexers
|
||||||
//TODO Optimize this so it's not called here and in NzbSearchService (for manual search)
|
//TODO Optimize this so it's not called here and in NzbSearchService (for manual search)
|
||||||
if (_indexerLimitService.AtQueryLimit(indexerDef))
|
if (_indexerLimitService.AtQueryLimit(indexerDef))
|
||||||
{
|
{
|
||||||
return Content(CreateErrorXML(500, $"Request limit reached ({((IIndexerSettings)indexer.Definition.Settings).BaseSettings.QueryLimit})"), "application/rss+xml");
|
return Content(CreateErrorXML(429, $"Request limit reached ({((IIndexerSettings)indexer.Definition.Settings).BaseSettings.QueryLimit})"), "application/rss+xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (requestType)
|
switch (requestType)
|
||||||
|
@ -171,7 +171,7 @@ namespace NzbDrone.Api.V1.Indexers
|
||||||
|
|
||||||
if (_indexerLimitService.AtDownloadLimit(indexerDef))
|
if (_indexerLimitService.AtDownloadLimit(indexerDef))
|
||||||
{
|
{
|
||||||
throw new BadRequestException("Grab limit reached");
|
return Content(CreateErrorXML(429, $"Grab limit reached ({((IIndexerSettings)indexer.Definition.Settings).BaseSettings.DownloadLimit})"), "application/rss+xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (link.IsNullOrWhiteSpace() || file.IsNullOrWhiteSpace())
|
if (link.IsNullOrWhiteSpace() || file.IsNullOrWhiteSpace())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue