mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05: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
|
ONE_DAY_IN_S = ONE_HOUR_IN_S * 24
|
||||||
FOUR_DAYS_IN_S = ONE_DAY_IN_S * 4
|
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}"
|
buildProjectSetKey = (project_id)-> return "clients_in_project:#{project_id}"
|
||||||
buildUserKey = (project_id, client_id)-> return "connected_user:#{project_id}:#{client_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)->
|
it "should add a ttl to the connected user so it stays clean", (done)->
|
||||||
@ConnectedUsersManager.markUserAsConnected @project_id, @client_id, @user, (err)=>
|
@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()
|
done()
|
||||||
|
|
||||||
describe "markUserAsDisconnected", ->
|
describe "markUserAsDisconnected", ->
|
||||||
|
@ -160,6 +160,6 @@ describe "ConnectedUsersManager", ->
|
||||||
|
|
||||||
it "should add the ttl on", (done)->
|
it "should add the ttl on", (done)->
|
||||||
@ConnectedUsersManager.setUserCursorPosition @project_id, @client_id, @cursorData, (err)=>
|
@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()
|
done()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue