mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-05-08 21:14:30 +02:00
Fixed: Change query timeout unit from milliseconds to seconds
This commit is contained in:
parent
11f6483d19
commit
8fe80f8683
3 changed files with 10 additions and 10 deletions
|
|
@ -526,8 +526,8 @@ protected virtual async Task<IndexerPageableQueryResult> FetchReleases(Func<IInd
|
|||
catch (TaskCanceledException ex)
|
||||
{
|
||||
_indexerStatusService.RecordFailure(Definition.Id);
|
||||
var timeoutMs = Settings.BaseSettings?.QueryTimeout ?? 100000;
|
||||
_logger.Warn(ex, "Unable to connect to indexer, possibly due to a timeout ({0} ms). [{1}]", timeoutMs, url);
|
||||
var timeoutSec = Settings.BaseSettings?.QueryTimeout ?? 100;
|
||||
_logger.Warn(ex, "Unable to connect to indexer, possibly due to a timeout ({0}s). [{1}]", timeoutSec, url);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -664,7 +664,7 @@ protected virtual async Task<IndexerResponse> FetchIndexerResponse(IndexerReques
|
|||
|
||||
if (request.HttpRequest.RequestTimeout == TimeSpan.Zero && Settings.BaseSettings != null)
|
||||
{
|
||||
request.HttpRequest.RequestTimeout = TimeSpan.FromMilliseconds(Settings.BaseSettings.QueryTimeout);
|
||||
request.HttpRequest.RequestTimeout = TimeSpan.FromSeconds(Settings.BaseSettings.QueryTimeout);
|
||||
}
|
||||
|
||||
var response = await RetryStrategy
|
||||
|
|
@ -844,8 +844,8 @@ protected virtual async Task<ValidationFailure> TestConnection()
|
|||
|
||||
if (webException.Message.Contains("timed out"))
|
||||
{
|
||||
var timeoutMs = Settings.BaseSettings?.QueryTimeout ?? 100000;
|
||||
return new ValidationFailure(string.Empty, "Unable to connect to indexer, request timed out after " + timeoutMs + " ms. Consider increasing the Query Timeout in the indexer advanced settings. " + webException.Message);
|
||||
var timeoutSec = Settings.BaseSettings?.QueryTimeout ?? 100;
|
||||
return new ValidationFailure(string.Empty, "Unable to connect to indexer, request timed out after " + timeoutSec + "s. Consider increasing the Query Timeout in the indexer advanced settings. " + webException.Message);
|
||||
}
|
||||
|
||||
if (webException.Message.Contains("502") || webException.Message.Contains("503") ||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ public IndexerCommonSettingsValidator()
|
|||
.WithMessage("Should be greater than zero");
|
||||
|
||||
RuleFor(c => c.QueryTimeout)
|
||||
.InclusiveBetween(50, 600000)
|
||||
.WithMessage("Must be between 50 ms and 600000 ms (10 minutes)");
|
||||
.InclusiveBetween(1, 300)
|
||||
.WithMessage("Must be between 1 and 300 seconds (5 minutes)");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -34,8 +34,8 @@ public class IndexerBaseSettings
|
|||
[FieldDefinition(3, Type = FieldType.Select, Label = "IndexerSettingsLimitsUnit", SelectOptions = typeof(IndexerLimitsUnit), HelpText = "IndexerSettingsLimitsUnitHelpText", Advanced = true)]
|
||||
public int LimitsUnit { get; set; } = (int)IndexerLimitsUnit.Day;
|
||||
|
||||
[FieldDefinition(4, Type = FieldType.Number, Label = "IndexerSettingsQueryTimeout", Unit = "ms", HelpText = "IndexerSettingsQueryTimeoutHelpText", Advanced = true)]
|
||||
public int QueryTimeout { get; set; } = 100000;
|
||||
[FieldDefinition(4, Type = FieldType.Number, Label = "IndexerSettingsQueryTimeout", Unit = "seconds", HelpText = "IndexerSettingsQueryTimeoutHelpText", Advanced = true)]
|
||||
public int QueryTimeout { get; set; } = 100;
|
||||
}
|
||||
|
||||
public enum IndexerLimitsUnit
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@
|
|||
"IndexerSettingsQueryLimit": "Query Limit",
|
||||
"IndexerSettingsQueryLimitHelpText": "The number of max queries as specified by the respective unit that {appName} will allow to the site",
|
||||
"IndexerSettingsQueryTimeout": "Query Timeout",
|
||||
"IndexerSettingsQueryTimeoutHelpText": "Query timeout in milliseconds for this indexer. Default is 100000 ms (100s). Increase for slow indexers, decrease for faster failure detection",
|
||||
"IndexerSettingsQueryTimeoutHelpText": "Query timeout in seconds for this indexer. Default is 100s. Increase for slow indexers, decrease for faster failure detection",
|
||||
"IndexerSettingsRssKey": "RSS Key",
|
||||
"IndexerSettingsSeedRatio": "Seed Ratio",
|
||||
"IndexerSettingsSeedRatioHelpText": "The ratio a torrent should reach before stopping, empty uses the download client's default. Ratio should be at least 1.0 and follow the indexers rules",
|
||||
|
|
|
|||
Loading…
Reference in a new issue