mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 11:01:56 +02:00
change client connection timeout to 15 mins expire in redis
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user