From bbaf88ae1f088584f9130852cd99ad372adce136 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 24 Mar 2015 23:54:32 -0400 Subject: update tv db cleanup --- .../Session/WebSocketController.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Server.Implementations/Session/WebSocketController.cs') diff --git a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs index 1e1949533..765664299 100644 --- a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs +++ b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs @@ -41,17 +41,25 @@ namespace MediaBrowser.Server.Implementations.Session } private bool _isActive; + private DateTime _lastActivityDate; public bool IsSessionActive { get { - return HasOpenSockets; + if (HasOpenSockets) + { + return true; + } + + //return false; + return _isActive && (DateTime.UtcNow - _lastActivityDate).TotalMinutes <= 10; } } public void OnActivity() { _isActive = true; + _lastActivityDate = DateTime.UtcNow; } private IEnumerable GetActiveSockets() -- cgit v1.2.3