Merge pull request #7961 from overleaf/jpa-shorter-clsi-persistence
[web] lower clsi persistence duration GitOrigin-RevId: 72929de084c5c5aac5f2382ad91a7665e96742a8
This commit is contained in:
@@ -129,6 +129,12 @@ module.exports = function (backendGroup) {
|
||||
)
|
||||
},
|
||||
|
||||
_getTTLInSeconds(clsiServerId) {
|
||||
return (clsiServerId || '').includes('-reg-')
|
||||
? Settings.clsiCookie.ttlInSecondsRegular
|
||||
: Settings.clsiCookie.ttlInSeconds
|
||||
},
|
||||
|
||||
setServerId(
|
||||
project_id,
|
||||
user_id,
|
||||
@@ -148,7 +154,7 @@ module.exports = function (backendGroup) {
|
||||
// We don't get a cookie back if it hasn't changed
|
||||
return rclient.expire(
|
||||
this.buildKey(project_id, user_id),
|
||||
Settings.clsiCookie.ttl,
|
||||
this._getTTLInSeconds(previous),
|
||||
err => callback(err, undefined)
|
||||
)
|
||||
}
|
||||
@@ -178,7 +184,7 @@ module.exports = function (backendGroup) {
|
||||
}
|
||||
rclient.setex(
|
||||
this.buildKey(project_id, user_id),
|
||||
Settings.clsiCookie.ttl,
|
||||
this._getTTLInSeconds(serverId),
|
||||
serverId,
|
||||
callback
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user