Browse Source

Type result

develop
Chocobozzz 1 week ago
parent
commit
90dbc73132
No known key found for this signature in database GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 7 deletions
  1. +3
    -7
      server/lib/redis.ts

+ 3
- 7
server/lib/redis.ts View File

@@ -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.')
}


Loading…
Cancel
Save