Skip to content

Commit

Permalink
refactor(server): simplify Redis store saveSession()
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Apr 6, 2023
1 parent 6ba2163 commit 9a00cea
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}

Expand Down

0 comments on commit 9a00cea

Please sign in to comment.