aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-11-18 07:15:06 -0600
committerJP Dillingham <jpdillingham@gmail.com>2021-11-18 07:15:06 -0600
commitc4180ef5dce447499e76a1604d2229adbe6a47b4 (patch)
treeced312ec7c79c25a2a7ee5ec8cd7ce73b2c59102 /src
parenta2057d62275dd899d0249501824ef15836f057d8 (diff)
parent6b83eb2d94d91b36cd6f674bd3d12e2250e694b3 (diff)
downloadslskd-c4180ef5dce447499e76a1604d2229adbe6a47b4.tar.gz
Merge remote-tracking branch 'origin/master' into remote-config
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Application.cs3
-rw-r--r--src/slskd/Core/API/Controllers/ApplicationController.cs15
-rw-r--r--src/slskd/Options.cs9
-rw-r--r--src/slskd/Program.cs2
-rw-r--r--src/slskd/Startup.cs5
-rw-r--r--src/slskd/slskd.csproj4
-rw-r--r--src/web/src/components/Transfers/TransferGroup.js4
7 files changed, 34 insertions, 8 deletions
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<byte>(),
uploadSlots: 1,
queueLength: 0,
hasFreeUploadSlot: false);
@@ -763,4 +762,4 @@ namespace slskd
return Task.FromResult(info);
}
}
-} \ No newline at end of file
+}
diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs
index 16cd68b9..82b1d6c5 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);
}
+
+ /// <summary>
+ /// Forces garbage collection.
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost("gc")]
+ [Authorize]
+ public IActionResult CollectGarbage()
+ {
+ GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
+ GC.Collect(2, GCCollectionMode.Forced, blocking: false, compacting: true);
+
+ return Ok();
+ }
}
}
diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs
index 2d9bcc1e..84b160c0 100644
--- a/src/slskd/Options.cs
+++ b/src/slskd/Options.cs
@@ -700,6 +700,15 @@ namespace slskd
public string ContentPath { get; private set; } = "wwwroot";
/// <summary>
+ /// Gets a value indicating whether HTTP request logging should be enabled.
+ /// </summary>
+ [Argument(default, "http-logging")]
+ [EnvironmentVariable("HTTP_LOGGING")]
+ [Description("enable http request logging")]
+ [RequiresRestart]
+ public bool Logging { get; private set; } = false;
+
+ /// <summary>
/// Gets authentication options.
/// </summary>
[Validate]
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index ae67ec8a..c70db953 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -139,7 +139,7 @@ namespace slskd
/// <summary>
/// Gets a buffer containing the last few log events.
/// </summary>
- public static ConcurrentFixedSizeQueue<LogRecord> LogBuffer { get; } = new ConcurrentFixedSizeQueue<LogRecord>(size: 500);
+ public static ConcurrentFixedSizeQueue<LogRecord> LogBuffer { get; } = new ConcurrentFixedSizeQueue<LogRecord>(size: 100);
private static IConfigurationRoot Configuration { get; set; }
private static OptionsAtStartup OptionsAtStartup { get; } = new OptionsAtStartup();
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();
diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj
index 124238e4..b6697133 100644
--- a/src/slskd/slskd.csproj
+++ b/src/slskd/slskd.csproj
@@ -64,11 +64,11 @@
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Grafana.Loki" Version="7.1.0" />
<PackageReference Include="Serilog.Sinks.Http" Version="7.2.0" />
- <PackageReference Include="SonarAnalyzer.CSharp" Version="8.30.0.37606">
+ <PackageReference Include="SonarAnalyzer.CSharp" Version="8.31.0.39249">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
- <PackageReference Include="Soulseek" Version="3.0.0-pre-1102210644" />
+ <PackageReference Include="Soulseek" Version="3.0.0-pre-991116210933" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
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 && <Button.Or/>}
{anyCancellable &&
@@ -144,4 +144,4 @@ class TransferGroup extends Component {
}
}
-export default TransferGroup; \ No newline at end of file
+export default TransferGroup;