From 299dbc204c182ca57ad5f08743db1ec8219b5b74 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 30 Jan 2022 10:24:02 -0600 Subject: add download slot config --- src/slskd/Options.cs | 10 ++++++++++ src/slskd/Startup.cs | 1 + 2 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index 7c9fae0a..5f674eaf 100644 --- a/src/slskd/Options.cs +++ b/src/slskd/Options.cs @@ -437,6 +437,16 @@ namespace slskd /// public class GlobalDownloadOptions { + /// + /// Gets the limit for the total number of download slots. + /// + [Argument(default, "download-slots")] + [EnvironmentVariable("DOWNLOAD_SLOTS")] + [Description("the total number of download slots")] + [RequiresRestart] + [Range(1, int.MaxValue)] + public int Slots { get; init; } = int.MaxValue; + /// /// Gets the total download speed limit. /// diff --git a/src/slskd/Startup.cs b/src/slskd/Startup.cs index dfe12824..658f62f8 100644 --- a/src/slskd/Startup.cs +++ b/src/slskd/Startup.cs @@ -236,6 +236,7 @@ namespace slskd services.AddSingleton(_ => new SoulseekClient(options: new SoulseekClientOptions( maximumConcurrentUploads: OptionsAtStartup.Global.Upload.Slots, + maximumConcurrentDownloads: OptionsAtStartup.Global.Download.Slots, minimumDiagnosticLevel: OptionsAtStartup.Soulseek.DiagnosticLevel))); // add the core application service to DI as well as a hosted service so that other services can -- cgit v1.2.3