diff options
-rw-r--r-- | server/lib/redis.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/server/lib/redis.ts b/server/lib/redis.ts index 4d7947d40..c0e9aece7 100644 --- a/server/lib/redis.ts +++ b/server/lib/redis.ts | |||
@@ -411,13 +411,9 @@ class Redis { | |||
411 | } | 411 | } |
412 | 412 | ||
413 | private async setValue (key: string, value: string, expirationMilliseconds?: number) { | 413 | private async setValue (key: string, value: string, expirationMilliseconds?: number) { |
414 | let result | 414 | const result = expirationMilliseconds !== undefined |
415 | 415 | ? await this.client.set(this.prefix + key, value, 'PX', expirationMilliseconds) | |
416 | if (expirationMilliseconds !== undefined) { | 416 | : await this.client.set(this.prefix + key, value) |
417 | result = await this.client.set(this.prefix + key, value, 'PX', expirationMilliseconds) | ||
418 | } else { | ||
419 | result = await this.client.set(this.prefix + key, value) | ||
420 | } | ||
421 | 417 | ||
422 | if (result !== 'OK') throw new Error('Redis set result is not OK.') | 418 | if (result !== 'OK') throw new Error('Redis set result is not OK.') |
423 | } | 419 | } |