aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core
diff options
context:
space:
mode:
Diffstat (limited to 'src/slskd/Core')
-rw-r--r--src/slskd/Core/API/Controllers/ApplicationController.cs2
-rw-r--r--src/slskd/Core/State.cs3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs
index ac8be802..7fb914e9 100644
--- a/src/slskd/Core/API/Controllers/ApplicationController.cs
+++ b/src/slskd/Core/API/Controllers/ApplicationController.cs
@@ -72,6 +72,7 @@ namespace slskd.Core.API
[Authorize]
public IActionResult Shutdown()
{
+ Program.MasterCancellationTokenSource.Cancel();
Lifetime.StopApplication();
Task.Run(async () =>
@@ -91,6 +92,7 @@ namespace slskd.Core.API
[Authorize]
public IActionResult Restart()
{
+ Program.MasterCancellationTokenSource.Cancel();
Process.Start(Process.GetCurrentProcess().MainModule.FileName, Environment.CommandLine);
Lifetime.StopApplication();
diff --git a/src/slskd/Core/State.cs b/src/slskd/Core/State.cs
index 1b798ad3..519f5345 100644
--- a/src/slskd/Core/State.cs
+++ b/src/slskd/Core/State.cs
@@ -104,6 +104,7 @@ namespace slskd
public bool Scanning { get; init; }
public bool Ready { get; init; }
public bool Faulted { get; init; }
+ public bool Cancelled { get; init; }
public double ScanProgress { get; init; }
public int Directories { get; init; }
public int Files { get; init; }
@@ -126,6 +127,8 @@ namespace slskd
/// </summary>
public bool Faulted { get; init; } = false;
+ public bool Cancelled { get; init; } = false;
+
/// <summary>
/// Gets the current fill progress.
/// </summary>