From 41f7bb4d0df6c4936c8f7e46e4599b18946288e4 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 11 Nov 2021 22:07:20 -0600 Subject: tweak garbage collection settings --- src/slskd/slskd.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index 124238e4..ad02c785 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -12,7 +12,8 @@ 9.0 Properties\analysis.ruleset true - false + true + true true -- cgit v1.2.3 From eb3dfc7934491d44b999224b51dbea69bbff0409 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 12 Nov 2021 07:10:24 -0600 Subject: use workstation garbage collection --- src/slskd/slskd.csproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index ad02c785..124238e4 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -12,8 +12,7 @@ 9.0 Properties\analysis.ruleset true - true - true + false true -- cgit v1.2.3 From d12b421a66becff8fa757bce363a9e874275c9c2 Mon Sep 17 00:00:00 2001 From: mathiascode Date: Sat, 13 Nov 2021 06:31:11 +0200 Subject: Don't send empty picture in user info response --- src/slskd/Application.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index f15d80ec..c6fdf8d8 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -755,7 +755,6 @@ namespace slskd { var info = new UserInfo( description: $"Soulseek.NET Web Example! also, your username is {username}, and IP endpoint is {endpoint}", - picture: Array.Empty(), uploadSlots: 1, queueLength: 0, hasFreeUploadSlot: false); @@ -763,4 +762,4 @@ namespace slskd return Task.FromResult(info); } } -} \ No newline at end of file +} -- cgit v1.2.3 From c1ea20c31218220d325826f0d2b121651309c2fe Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 13 Nov 2021 13:00:08 -0600 Subject: bump dependencies, add route to force garbage collection --- src/slskd/Core/API/Controllers/ApplicationController.cs | 15 +++++++++++++++ src/slskd/slskd.csproj | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs index 16cd68b9..a7168efb 100644 --- a/src/slskd/Core/API/Controllers/ApplicationController.cs +++ b/src/slskd/Core/API/Controllers/ApplicationController.cs @@ -19,6 +19,7 @@ namespace slskd.Core.API { using System; using System.Diagnostics; + using System.Runtime; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -111,5 +112,19 @@ namespace slskd.Core.API return Ok(ApplicationStateMonitor.CurrentValue.Version); } + + /// + /// Forces garbage collection. + /// + /// + [HttpPost("gc")] + [Authorize] + public async Task CollectGarbage() + { + GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; + GC.Collect(2, GCCollectionMode.Forced, blocking: false, compacting: true); + + return Ok(); + } } } diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index 124238e4..58f7cfe0 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -64,11 +64,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive -- cgit v1.2.3 From 7439e0ef4db92941455af3e4f5b4e3736a51d6dc Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 13 Nov 2021 15:00:05 -0600 Subject: add option to suppress HTTP logging --- config/slskd.example.yml | 1 + src/slskd/Options.cs | 9 +++++++++ src/slskd/Startup.cs | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/config/slskd.example.yml b/config/slskd.example.yml index 643911e2..ce424595 100644 --- a/config/slskd.example.yml +++ b/config/slskd.example.yml @@ -25,6 +25,7 @@ # password: ~ # url_base: / # content_path: wwwroot +# logging: false # authentication: # disable: false # username: slskd diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index 71c341e9..0d487cc2 100644 --- a/src/slskd/Options.cs +++ b/src/slskd/Options.cs @@ -691,6 +691,15 @@ namespace slskd [RequiresRestart] public string ContentPath { get; private set; } = "wwwroot"; + /// + /// Gets a value indicating whether HTTP request logging should be enabled. + /// + [Argument(default, "http-logging")] + [EnvironmentVariable("HTTP_LOGGING")] + [Description("enable http request logging")] + [RequiresRestart] + public bool Logging { get; private set; } = false; + /// /// Gets authentication options. /// diff --git a/src/slskd/Startup.cs b/src/slskd/Startup.cs index 98deac0d..a8b64305 100644 --- a/src/slskd/Startup.cs +++ b/src/slskd/Startup.cs @@ -324,7 +324,10 @@ namespace slskd logger.Information("Publishing Prometheus metrics to /metrics"); } - app.UseSerilogRequestLogging(); + if (OptionsAtStartup.Web.Logging) + { + app.UseSerilogRequestLogging(); + } app.UseAuthentication(); -- cgit v1.2.3 From abd17f77343568550c37f82a14d370d3c20a1d9a Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 13 Nov 2021 21:10:06 -0600 Subject: reduce log buffer to 100 --- src/slskd/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 2403dbbf..4c772772 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -134,7 +134,7 @@ namespace slskd /// /// Gets a buffer containing the last few log events. /// - public static ConcurrentFixedSizeQueue LogBuffer { get; } = new ConcurrentFixedSizeQueue(size: 500); + public static ConcurrentFixedSizeQueue LogBuffer { get; } = new ConcurrentFixedSizeQueue(size: 100); private static IConfigurationRoot Configuration { get; set; } private static string ConfigurationFile => Path.Combine(AppDirectory, $"{AppName}.yml"); -- cgit v1.2.3 From 9d08c01e63f42c023ac0530fc1a28ca53ae354fc Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 13 Nov 2021 22:54:12 -0600 Subject: bump Soulseek.NET --- src/slskd/slskd.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index 58f7cfe0..3faeff54 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -68,7 +68,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive -- cgit v1.2.3 From d3d50f4c52a3434634a6a84cc8c5d8b6b683c631 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 13 Nov 2021 23:43:25 -0600 Subject: bump Soulseek.NET again --- src/slskd/slskd.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index 3faeff54..58280684 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -68,7 +68,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive -- cgit v1.2.3 From 7211841a0a4993ce210d45ac62ca3e443b786acc Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 13 Nov 2021 23:55:12 -0600 Subject: again --- src/slskd/slskd.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index 58280684..bb0f263e 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -68,7 +68,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive -- cgit v1.2.3 From 7524467413ba48ce8c5a0c11ee023103b0d192f6 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 14 Nov 2021 08:49:29 -0600 Subject: bump Soulseek.NET --- src/slskd/slskd.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index bb0f263e..d659e947 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -68,7 +68,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive -- cgit v1.2.3 From 7aaa25de74092068d8305b0d1c0354e56a8503e7 Mon Sep 17 00:00:00 2001 From: Muppetteer Date: Mon, 15 Nov 2021 15:55:21 +1100 Subject: Retry button on failed downloads fails with a script error Clicking retry on a failed download does not seem to work at all for me. To reproduce: 1. Search for something to download. 2. Switch to downloads tab and watch it start. 3. Force it to fail somehow. 4. Progress says "Completed, Errored" and the progress bar is 100% red. 5. Select the failed download and press the retry button at bottom of the page. This error is being logged in the browser console. ``` Uncaught (in promise) TypeError: e.map is not a function retryAll TransferGroup.js:54 onClick TransferGroup.js:123 Lodash 4 handleClick Button.js:63 React 12 unstable_runWithPriority scheduler.production.min.js:19 React 3 ``` Looking at it TransferGroup->retryAll function is expecting 1 parameter but it is being called with 3. Only the 3rd parameter should be used (map of selected items). This is untested as I am running slskd in a Docker container and can't work out how to edit the source inside it. --- src/web/src/components/Transfers/TransferGroup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/web/src/components/Transfers/TransferGroup.js b/src/web/src/components/Transfers/TransferGroup.js index db093303..f2c5263d 100644 --- a/src/web/src/components/Transfers/TransferGroup.js +++ b/src/web/src/components/Transfers/TransferGroup.js @@ -120,7 +120,7 @@ class TransferGroup extends Component { icon='redo' color='green' content={`Retry${all}`} - onClick={() => this.retryAll(direction, user.username, selected)} + onClick={() => this.retryAll(selected)} />} {allRetryable && anyCancellable && } {anyCancellable && @@ -144,4 +144,4 @@ class TransferGroup extends Component { } } -export default TransferGroup; \ No newline at end of file +export default TransferGroup; -- cgit v1.2.3 From b036949d6a9a71c0bc8c83d9e494f594ade4d6a8 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 15 Nov 2021 09:10:07 -0600 Subject: bump Soulseek.NET --- src/slskd/Core/API/Controllers/ApplicationController.cs | 2 +- src/slskd/slskd.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs index a7168efb..82b1d6c5 100644 --- a/src/slskd/Core/API/Controllers/ApplicationController.cs +++ b/src/slskd/Core/API/Controllers/ApplicationController.cs @@ -119,7 +119,7 @@ namespace slskd.Core.API /// [HttpPost("gc")] [Authorize] - public async Task CollectGarbage() + public IActionResult CollectGarbage() { GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; GC.Collect(2, GCCollectionMode.Forced, blocking: false, compacting: true); diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index d659e947..c0221df4 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -68,7 +68,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive -- cgit v1.2.3 From 15a5632d048ca532c4998e0b0b00b55ec0c744e2 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 15 Nov 2021 11:29:32 -0600 Subject: bump Soulseek.NET again --- src/slskd/slskd.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index c0221df4..11b36862 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -68,7 +68,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive -- cgit v1.2.3 From 4873b2344b80cd9553efc0a21dff4ae220f8a391 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 15 Nov 2021 17:43:38 -0600 Subject: bump Soulseek.NET again --- src/slskd/slskd.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index 11b36862..aade1df5 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -68,7 +68,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive -- cgit v1.2.3 From 3d63894795bbcdcd65df68f3e0580f2311735bfc Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 16 Nov 2021 09:45:12 -0600 Subject: bump Soulseek.NET --- src/slskd/slskd.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index aade1df5..b6697133 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -68,7 +68,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive -- cgit v1.2.3