aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/redis.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/redis.ts')
-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 d052de786..d6d053d2f 100644
--- a/server/lib/redis.ts
+++ b/server/lib/redis.ts
@@ -1,4 +1,4 @@
1import { createClient, RedisClientOptions, RedisModules, RedisScripts } from 'redis' 1import { createClient, RedisClientOptions, RedisModules } from 'redis'
2import { exists } from '@server/helpers/custom-validators/misc' 2import { exists } from '@server/helpers/custom-validators/misc'
3import { sha256 } from '@shared/extra-utils' 3import { sha256 } from '@shared/extra-utils'
4import { logger } from '../helpers/logger' 4import { logger } from '../helpers/logger'
@@ -16,16 +16,12 @@ import {
16 WEBSERVER 16 WEBSERVER
17} from '../initializers/constants' 17} from '../initializers/constants'
18 18
19// Only used for typings
20// TODO: remove when https://github.com/microsoft/TypeScript/issues/37181 is fixed
21const redisClientWrapperForType = () => createClient<{}, RedisScripts>()
22
23class Redis { 19class Redis {
24 20
25 private static instance: Redis 21 private static instance: Redis
26 private initialized = false 22 private initialized = false
27 private connected = false 23 private connected = false
28 private client: ReturnType<typeof redisClientWrapperForType> 24 private client: ReturnType<typeof createClient>
29 private prefix: string 25 private prefix: string
30 26
31 private constructor () { 27 private constructor () {
@@ -308,7 +304,7 @@ class Redis {
308 return this.deleteKey('resumable-upload-' + uploadId) 304 return this.deleteKey('resumable-upload-' + uploadId)
309 } 305 }
310 306
311 /* ************ AP ressource unavailability ************ */ 307 /* ************ AP resource unavailability ************ */
312 308
313 async addAPUnavailability (url: string) { 309 async addAPUnavailability (url: string) {
314 const key = this.generateAPUnavailabilityKey(url) 310 const key = this.generateAPUnavailabilityKey(url)