mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 03:26:07 +02:00
Merge pull request #1644 from Bond-009/hiddenwarn
Fix possible hidden exceptions
This commit is contained in:
commit
c8474f734c
1 changed files with 17 additions and 11 deletions
|
@ -150,14 +150,15 @@ namespace Jellyfin.Server
|
||||||
_logger.LogWarning("Failed to enable shared cache for SQLite");
|
_logger.LogWarning("Failed to enable shared cache for SQLite");
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var appHost = new CoreAppHost(
|
var appHost = new CoreAppHost(
|
||||||
appPaths,
|
appPaths,
|
||||||
_loggerFactory,
|
_loggerFactory,
|
||||||
options,
|
options,
|
||||||
new ManagedFileSystem(_loggerFactory.CreateLogger<ManagedFileSystem>(), appPaths),
|
new ManagedFileSystem(_loggerFactory.CreateLogger<ManagedFileSystem>(), appPaths),
|
||||||
new NullImageEncoder(),
|
new NullImageEncoder(),
|
||||||
new NetworkManager(_loggerFactory.CreateLogger<NetworkManager>()),
|
new NetworkManager(_loggerFactory.CreateLogger<NetworkManager>()),
|
||||||
appConfig))
|
appConfig);
|
||||||
|
try
|
||||||
{
|
{
|
||||||
await appHost.InitAsync(new ServiceCollection()).ConfigureAwait(false);
|
await appHost.InitAsync(new ServiceCollection()).ConfigureAwait(false);
|
||||||
|
|
||||||
|
@ -165,8 +166,6 @@ namespace Jellyfin.Server
|
||||||
|
|
||||||
await appHost.RunStartupTasksAsync().ConfigureAwait(false);
|
await appHost.RunStartupTasksAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Block main thread until shutdown
|
// Block main thread until shutdown
|
||||||
await Task.Delay(-1, _tokenSource.Token).ConfigureAwait(false);
|
await Task.Delay(-1, _tokenSource.Token).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
@ -174,6 +173,13 @@ namespace Jellyfin.Server
|
||||||
{
|
{
|
||||||
// Don't throw on cancellation
|
// Don't throw on cancellation
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogCritical(ex, "Error while starting server.");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
appHost?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_restartOnShutdown)
|
if (_restartOnShutdown)
|
||||||
|
|
Loading…
Reference in a new issue