refactor(server): simplify Redis store saveSession()

This commit is contained in:
Damien Arrachequesne 2023-04-06 18:01:52 +02:00
parent 6ba21636d3
commit 9a00cea5b4
No known key found for this signature in database
GPG Key ID: 544D14663E7F7CF0
1 changed files with 6 additions and 6 deletions

View File

@ -62,12 +62,12 @@ export class RedisStore extends Store {
}
saveSession(sessionId: string) {
const key = this.computeKey(sessionId);
this.redisClient
.multi()
.set(key, true)
.expire(key, this.options.sessionDuration)
.exec();
this.redisClient.set(
this.computeKey(sessionId),
"1",
"EX",
"" + this.options.sessionDuration
);
}
}