mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-28 13:01:57 +00:00
move session examination inside the lock
This commit is contained in:
@@ -175,19 +175,19 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
|
||||
public async Task ReportSessionEnded(Guid sessionId)
|
||||
{
|
||||
var session = GetSession(sessionId);
|
||||
|
||||
if (session == null)
|
||||
{
|
||||
throw new ArgumentException("Session not found");
|
||||
}
|
||||
|
||||
var key = GetSessionKey(session.Client, session.ApplicationVersion, session.DeviceId);
|
||||
|
||||
await _sessionLock.WaitAsync(CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
try
|
||||
{
|
||||
var session = GetSession(sessionId);
|
||||
|
||||
if (session == null)
|
||||
{
|
||||
throw new ArgumentException("Session not found");
|
||||
}
|
||||
|
||||
var key = GetSessionKey(session.Client, session.ApplicationVersion, session.DeviceId);
|
||||
|
||||
SessionInfo removed;
|
||||
|
||||
if (_activeConnections.TryRemove(key, out removed))
|
||||
|
||||
Reference in New Issue
Block a user