diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-24 23:54:32 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-24 23:54:32 -0400 |
| commit | bbaf88ae1f088584f9130852cd99ad372adce136 (patch) | |
| tree | d3f1f19c44527f96d603b09a6c960f33b3efd2c7 /MediaBrowser.Server.Implementations/Session/WebSocketController.cs | |
| parent | e62270df353aa8e2ae0a20aeff7d5aa6f9b62630 (diff) | |
update tv db cleanup
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/WebSocketController.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/WebSocketController.cs | 10 |
1 files changed, 9 insertions, 1 deletions
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<IWebSocketConnection> GetActiveSockets() |
