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