From 9a00cea5b42e31915fb50b79d01257e6dfd9e402 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Thu, 6 Apr 2023 18:01:52 +0200 Subject: [PATCH] refactor(server): simplify Redis store saveSession() --- lib/stores.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/stores.ts b/lib/stores.ts index 174409d..b9eda43 100644 --- a/lib/stores.ts +++ b/lib/stores.ts @@ -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 + ); } }