aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2019-01-13 00:55:37 +0100
committerBond_009 <bond.009@outlook.com>2019-01-13 00:55:37 +0100
commitbf4de012da46a7ee875c5439c4a0f1355d8978d2 (patch)
treeb6dee821830b1989b13e3b03494448a1103efbaa
parentdebb8e56fd32184c9d968e0450ceca437dea7d11 (diff)
Catch exception instead of masking it
-rw-r--r--Jellyfin.Server/Program.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 7079ca7f5..d370cdc69 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -105,9 +105,16 @@ namespace Jellyfin.Server
await appHost.RunStartupTasks();
// TODO: read input for a stop command
- // Block main thread until shutdown
- await Task.Delay(-1, _tokenSource.Token)
- .ContinueWith(delegate{}); // Don't throw on cancellation
+
+ try
+ {
+ // Block main thread until shutdown
+ await Task.Delay(-1, _tokenSource.Token);
+ }
+ catch (TaskCanceledException)
+ {
+ // Don't throw on cancellation
+ }
_logger.LogInformation("Disposing app host");
}