mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -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));
|
HttpServer.Init(GetExports<IRestfulService>(false));
|
||||||
|
|
||||||
ServerManager.AddWebSocketListeners(GetExports<IWebSocketListener>(false));
|
ServerManager.AddWebSocketListeners(GetExports<IWebSocketListener>(false));
|
||||||
ServerManager.Start();
|
|
||||||
|
StartServer(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
() => LibraryManager.AddParts(GetExports<IResolverIgnoreRule>(), GetExports<IVirtualFolderCreator>(), GetExports<IItemResolver>(), GetExports<IIntroProvider>(), GetExports<IBaseItemComparer>()),
|
() => 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>
|
/// <summary>
|
||||||
/// Restarts this instance.
|
/// Restarts this instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user