mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 14:23:35 +00:00
change client connection timeout to 15 mins expire in redis
This commit is contained in:
parent
478910a3aa
commit
554fd7c7d0
2 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ ONE_HOUR_IN_S = 60 * 60
|
|||
ONE_DAY_IN_S = ONE_HOUR_IN_S * 24
|
||||
FOUR_DAYS_IN_S = ONE_DAY_IN_S * 4
|
||||
|
||||
USER_TIMEOUT_IN_S = ONE_HOUR_IN_S
|
||||
USER_TIMEOUT_IN_S = ONE_HOUR_IN_S / 4
|
||||
|
||||
buildProjectSetKey = (project_id)-> return "clients_in_project:#{project_id}"
|
||||
buildUserKey = (project_id, client_id)-> return "connected_user:#{project_id}:#{client_id}"
|
||||
|
|
|
@ -89,7 +89,7 @@ describe "ConnectedUsersManager", ->
|
|||
|
||||
it "should add a ttl to the connected user so it stays clean", (done)->
|
||||
@ConnectedUsersManager.markUserAsConnected @project_id, @client_id, @user, (err)=>
|
||||
@rClient.expire.calledWith("connected_user:#{@project_id}:#{@client_id}", 60 * 60).should.equal true
|
||||
@rClient.expire.calledWith("connected_user:#{@project_id}:#{@client_id}", 60 * 15).should.equal true
|
||||
done()
|
||||
|
||||
describe "markUserAsDisconnected", ->
|
||||
|
@ -160,6 +160,6 @@ describe "ConnectedUsersManager", ->
|
|||
|
||||
it "should add the ttl on", (done)->
|
||||
@ConnectedUsersManager.setUserCursorPosition @project_id, @client_id, @cursorData, (err)=>
|
||||
@rClient.expire.calledWith("connected_user:#{@project_id}:#{@client_id}", 60 * 60).should.equal true
|
||||
@rClient.expire.calledWith("connected_user:#{@project_id}:#{@client_id}", 60 * 15).should.equal true
|
||||
done()
|
||||
|
||||
|
|
Loading…
Reference in a new issue