浏览代码

Merge pull request #6582 from Bond-009/shutdown

Allow shutdown while starting WebHost
Claus Vium 3 年之前
父节点
当前提交
9bb222b408
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Jellyfin.Server/Program.cs

+ 2 - 2
Jellyfin.Server/Program.cs

@@ -195,9 +195,9 @@ namespace Jellyfin.Server
 
                 try
                 {
-                    await webHost.StartAsync().ConfigureAwait(false);
+                    await webHost.StartAsync(_tokenSource.Token).ConfigureAwait(false);
                 }
-                catch
+                catch (Exception ex) when (ex is not TaskCanceledException)
                 {
                     _logger.LogError("Kestrel failed to start! This is most likely due to an invalid address or port bind - correct your bind configuration in network.xml and try again.");
                     throw;