From bbe510099e3986e52aec472abe3752ebbce3d120 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 15 Oct 2015 11:38:23 +0100 Subject: [PATCH] change auto disconnect to 24 hours and expose it publicly for easier testing --- .../public/coffee/ide/connection/ConnectionManager.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide/connection/ConnectionManager.coffee b/services/web/public/coffee/ide/connection/ConnectionManager.coffee index 6625f02f9f..b33566d208 100644 --- a/services/web/public/coffee/ide/connection/ConnectionManager.coffee +++ b/services/web/public/coffee/ide/connection/ConnectionManager.coffee @@ -2,6 +2,9 @@ define [], () -> ONEHOUR = 1000 * 60 * 60 class ConnectionManager + + disconnectAfterMs: ONEHOUR * 24 + lastUserAction : new Date() constructor: (@ide, @$scope) -> @@ -161,7 +164,7 @@ define [], () -> setTimeout (=> @startAutoReconnectCountdown() if !@connected), 2000 disconnectIfInactive: ()-> - @userIsInactive = (new Date() - @lastUserAction) > ONEHOUR * 12 + @userIsInactive = (new Date() - @lastUserAction) > @disconnectAfterMs if @userIsInactive and @connected @disconnect() @$scope.$apply () =>