aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core/API/Controllers/ApplicationController.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-09-24 16:21:20 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-09-24 16:21:20 -0500
commitdb73de70aa1e3d28707da66271b9962046ebcc8c (patch)
treeaf087b4fa9d4c0393ed601ec483fd44e6024322a /src/slskd/Core/API/Controllers/ApplicationController.cs
parent721a1436960746df84410cfb4b6626f50df62f43 (diff)
downloadslskd-db73de70aa1e3d28707da66271b9962046ebcc8c.tar.gz
cancel master token on shutdown and reboot
Diffstat (limited to 'src/slskd/Core/API/Controllers/ApplicationController.cs')
-rw-r--r--src/slskd/Core/API/Controllers/ApplicationController.cs2
1 files changed, 2 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();