Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Type result

Chocobozzz90dbc73132f2
diff --git a/server/lib/redis.ts b/server/lib/redis.ts
index 4d7947d40e..c0e9aece74 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.')
}