mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
change auto disconnect to 24 hours and expose it publicly for easier testing
This commit is contained in:
parent
2f48568f76
commit
bbe510099e
1 changed files with 4 additions and 1 deletions
|
@ -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 () =>
|
||||
|
|
Loading…
Reference in a new issue