mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-05 21:37:10 -04:00
fixes #224 - Exception trying to start server after a reboot
This commit is contained in:
parent
b4bcb07c38
commit
de6acec504
@ -382,7 +382,8 @@ namespace MediaBrowser.ServerApplication
|
||||
HttpServer.Init(GetExports<IRestfulService>(false));
|
||||
|
||||
ServerManager.AddWebSocketListeners(GetExports<IWebSocketListener>(false));
|
||||
ServerManager.Start();
|
||||
|
||||
StartServer(true);
|
||||
},
|
||||
|
||||
() => LibraryManager.AddParts(GetExports<IResolverIgnoreRule>(), GetExports<IVirtualFolderCreator>(), GetExports<IItemResolver>(), GetExports<IIntroProvider>(), GetExports<IBaseItemComparer>()),
|
||||
@ -405,6 +406,31 @@ namespace MediaBrowser.ServerApplication
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the server.
|
||||
/// </summary>
|
||||
/// <param name="retryOnFailure">if set to <c>true</c> [retry on failure].</param>
|
||||
private void StartServer(bool retryOnFailure)
|
||||
{
|
||||
try
|
||||
{
|
||||
ServerManager.Start();
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (retryOnFailure)
|
||||
{
|
||||
RegisterServerWithAdministratorAccess();
|
||||
|
||||
StartServer(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restarts this instance.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user