From 8fe80f868348213df88a4c96df5891c9024e638c Mon Sep 17 00:00:00 2001 From: Simone Filippini Date: Thu, 12 Mar 2026 15:13:50 +0100 Subject: [PATCH] Fixed: Change query timeout unit from milliseconds to seconds --- src/NzbDrone.Core/Indexers/HttpIndexerBase.cs | 10 +++++----- src/NzbDrone.Core/Indexers/IndexerBaseSettings.cs | 8 ++++---- src/NzbDrone.Core/Localization/Core/en.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index 33cfc4fdb..26c511a57 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -526,8 +526,8 @@ protected virtual async Task FetchReleases(Func 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 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") || diff --git a/src/NzbDrone.Core/Indexers/IndexerBaseSettings.cs b/src/NzbDrone.Core/Indexers/IndexerBaseSettings.cs index 0ee740a48..651aefe8f 100644 --- a/src/NzbDrone.Core/Indexers/IndexerBaseSettings.cs +++ b/src/NzbDrone.Core/Indexers/IndexerBaseSettings.cs @@ -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 diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 10aff3d56..1c6b34c44 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -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",