From 03952c1a9f959b3f87b0a627baad635018c0f39e Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 9 Jan 2022 23:05:40 -0600 Subject: clear yaml provider dictionary before loading --- src/slskd/Common/Configuration/YamlConfigurationSource.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/slskd/Common/Configuration/YamlConfigurationSource.cs') diff --git a/src/slskd/Common/Configuration/YamlConfigurationSource.cs b/src/slskd/Common/Configuration/YamlConfigurationSource.cs index cd388f46..191e49ab 100644 --- a/src/slskd/Common/Configuration/YamlConfigurationSource.cs +++ b/src/slskd/Common/Configuration/YamlConfigurationSource.cs @@ -109,6 +109,11 @@ namespace slskd.Configuration { try { + // clear the data collection before we populate + // not doing this will cause array and dictionary keys + // to get "stuck" + Data.Clear(); + using var reader = new StreamReader(stream); var yaml = new YamlStream(); -- cgit v1.2.3 From d5e3a4776716a1348e8603c1054bf0f33967fa1e Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 10 Jan 2022 09:09:03 -0600 Subject: don't require a restart if slots change --- src/slskd/Common/Configuration/YamlConfigurationSource.cs | 2 +- src/slskd/Options.cs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/slskd/Common/Configuration/YamlConfigurationSource.cs') diff --git a/src/slskd/Common/Configuration/YamlConfigurationSource.cs b/src/slskd/Common/Configuration/YamlConfigurationSource.cs index 191e49ab..7f2c548d 100644 --- a/src/slskd/Common/Configuration/YamlConfigurationSource.cs +++ b/src/slskd/Common/Configuration/YamlConfigurationSource.cs @@ -111,7 +111,7 @@ namespace slskd.Configuration { // clear the data collection before we populate // not doing this will cause array and dictionary keys - // to get "stuck" + // to get "stuck" when the config is reloaded Data.Clear(); using var reader = new StreamReader(stream); diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index 0d7fb4fe..bffc1be9 100644 --- a/src/slskd/Options.cs +++ b/src/slskd/Options.cs @@ -435,7 +435,6 @@ namespace slskd public string Strategy { get; init; } = "roundrobin"; [Argument(default, "queue-slots")] - [RequiresRestart] [Range(1, int.MaxValue)] public int Slots { get; init; } = 10; @@ -448,7 +447,6 @@ namespace slskd [Enum(typeof(QueueStrategy))] public string Strategy { get; init; } = "roundrobin"; - [RequiresRestart] [Range(1, int.MaxValue)] public int Slots { get; init; } = 10; -- cgit v1.2.3