mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-28 19:54:48 +03:00
Fix web sockets closing ungracefully
This commit is contained in:
@@ -1363,9 +1363,26 @@ namespace Emby.Server.Implementations.Session
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
CloseAllWebSockets(cancellationToken);
|
||||
|
||||
return SendMessageToSessions(Sessions, SessionMessageType.ServerShuttingDown, string.Empty, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gracefully closes all web sockets in all sessions.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
private void CloseAllWebSockets(CancellationToken cancellationToken)
|
||||
{
|
||||
foreach (var session in Sessions)
|
||||
{
|
||||
foreach (var sessionController in session.SessionControllers)
|
||||
{
|
||||
sessionController.CloseAllWebSockets(cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the server restart notification.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user