mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 09:04:42 +01:00
Merge pull request #1644 from Bond-009/hiddenwarn
Fix possible hidden exceptions
This commit is contained in:
@@ -150,14 +150,15 @@ namespace Jellyfin.Server
|
||||
_logger.LogWarning("Failed to enable shared cache for SQLite");
|
||||
}
|
||||
|
||||
using (var appHost = new CoreAppHost(
|
||||
var appHost = new CoreAppHost(
|
||||
appPaths,
|
||||
_loggerFactory,
|
||||
options,
|
||||
new ManagedFileSystem(_loggerFactory.CreateLogger<ManagedFileSystem>(), appPaths),
|
||||
new NullImageEncoder(),
|
||||
new NetworkManager(_loggerFactory.CreateLogger<NetworkManager>()),
|
||||
appConfig))
|
||||
appConfig);
|
||||
try
|
||||
{
|
||||
await appHost.InitAsync(new ServiceCollection()).ConfigureAwait(false);
|
||||
|
||||
@@ -165,15 +166,20 @@ namespace Jellyfin.Server
|
||||
|
||||
await appHost.RunStartupTasksAsync().ConfigureAwait(false);
|
||||
|
||||
try
|
||||
{
|
||||
// Block main thread until shutdown
|
||||
await Task.Delay(-1, _tokenSource.Token).ConfigureAwait(false);
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
{
|
||||
// Don't throw on cancellation
|
||||
}
|
||||
// Block main thread until shutdown
|
||||
await Task.Delay(-1, _tokenSource.Token).ConfigureAwait(false);
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
{
|
||||
// Don't throw on cancellation
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical(ex, "Error while starting server.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
appHost?.Dispose();
|
||||
}
|
||||
|
||||
if (_restartOnShutdown)
|
||||
|
||||
Reference in New Issue
Block a user