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 { } private async setValue (key: string, value: string, expirationMilliseconds?: number) { - let result - - if (expirationMilliseconds !== undefined) { - result = await this.client.set(this.prefix + key, value, 'PX', expirationMilliseconds) - } else { - result = await this.client.set(this.prefix + key, value) - } + const result = expirationMilliseconds !== undefined + ? await this.client.set(this.prefix + key, value, 'PX', expirationMilliseconds) + : await this.client.set(this.prefix + key, value) if (result !== 'OK') throw new Error('Redis set result is not OK.') }