aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-11-14 16:36:17 +0100
committerChocobozzz <me@florianbigard.com>2022-11-14 16:36:17 +0100
commit90dbc73132f22888a60628d921c92f938499bd7b (patch)
tree2975502d5bbcc93bf9e22d07a8bec71500fa7135 /server/lib
parent564b9b55976873d87e669ace916f037b72fe2865 (diff)
downloadPeerTube-90dbc73132f22888a60628d921c92f938499bd7b.tar.gz
PeerTube-90dbc73132f22888a60628d921c92f938499bd7b.tar.zst
PeerTube-90dbc73132f22888a60628d921c92f938499bd7b.zip
Type result
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/redis.ts10
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 }