From 79fb693cbb3d10d035944bb0a8eb324f2d9311f4 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 25 Sep 2022 14:41:55 -0500 Subject: default scan workers to Environment.ProcessorCount --- src/slskd/Core/Options.cs | 52 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 070476d1..937804de 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -380,32 +380,6 @@ namespace slskd [Validate] public ShareCacheOptions Cache { get; init; } = new ShareCacheOptions(); - /// - /// Share caching options. - /// - public class ShareCacheOptions - { - /// - /// Gets the type of storage to use for the share cache. - /// - [Argument(default, "share-cache-storage-mode")] - [EnvironmentVariable("SHARE_CACHE_STORAGE_MODE")] - [Description("the type of storage to use for the cache")] - [Enum(typeof(StorageMode))] - [RequiresRestart] - public string StorageMode { get; init; } = slskd.StorageMode.Memory.ToString().ToLowerInvariant(); - - /// - /// Gets the number of workers to use while scanning shares. - /// - [Argument(default, "share-cache-workers")] - [EnvironmentVariable("SHARE_CACHE_WORKERS")] - [Description("the number of workers to use while scanning shares")] - [Range(1, 128)] - [RequiresRestart] - public int Workers { get; init; } = 16; - } - /// /// Extended validation. /// @@ -492,6 +466,32 @@ namespace slskd return results; } + + /// + /// Share caching options. + /// + public class ShareCacheOptions + { + /// + /// Gets the type of storage to use for the share cache. + /// + [Argument(default, "share-cache-storage-mode")] + [EnvironmentVariable("SHARE_CACHE_STORAGE_MODE")] + [Description("the type of storage to use for the cache")] + [Enum(typeof(StorageMode))] + [RequiresRestart] + public string StorageMode { get; init; } = slskd.StorageMode.Memory.ToString().ToLowerInvariant(); + + /// + /// Gets the number of workers to use while scanning shares. + /// + [Argument(default, "share-cache-workers")] + [EnvironmentVariable("SHARE_CACHE_WORKERS")] + [Description("the number of workers to use while scanning shares")] + [Range(1, 128)] + [RequiresRestart] + public int Workers { get; init; } = Environment.ProcessorCount; + } } /// -- cgit v1.2.3