diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-09-25 14:46:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-25 14:46:26 -0500 |
| commit | b1fd4801196ac8d69355f604dd615b1052696961 (patch) | |
| tree | e016b346ddd9bee56ea6e037d1f82ed35476da95 /src | |
| parent | cabbd9c2fcb30c6194d25045dd4a9f4bdf6d6e4f (diff) | |
| parent | 79fb693cbb3d10d035944bb0a8eb324f2d9311f4 (diff) | |
| download | slskd-b1fd4801196ac8d69355f604dd615b1052696961.tar.gz | |
Merge pull request #661 from slskd/workers
Default scan workers to Environment.ProcessorCount
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/Options.cs | 52 |
1 files changed, 26 insertions, 26 deletions
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 @@ -381,32 +381,6 @@ namespace slskd public ShareCacheOptions Cache { get; init; } = new ShareCacheOptions(); /// <summary> - /// Share caching options. - /// </summary> - public class ShareCacheOptions - { - /// <summary> - /// Gets the type of storage to use for the share cache. - /// </summary> - [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(); - - /// <summary> - /// Gets the number of workers to use while scanning shares. - /// </summary> - [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; - } - - /// <summary> /// Extended validation. /// </summary> /// <param name="validationContext"></param> @@ -492,6 +466,32 @@ namespace slskd return results; } + + /// <summary> + /// Share caching options. + /// </summary> + public class ShareCacheOptions + { + /// <summary> + /// Gets the type of storage to use for the share cache. + /// </summary> + [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(); + + /// <summary> + /// Gets the number of workers to use while scanning shares. + /// </summary> + [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; + } } /// <summary> |
