X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fredis.ts;h=f77d0b62c20ba22d3a92c01da5e097b7b35cf8c1;hb=b6a1dd4d1b3b0032f8b968e72cbd074f646e8827;hp=b4044bf0f62c27c00fcaf26338080ddec5376481;hpb=74dc3bca2b14f5fd3fe80c394dfc34177a46db77;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/redis.ts b/server/lib/redis.ts index b4044bf0f..f77d0b62c 100644 --- a/server/lib/redis.ts +++ b/server/lib/redis.ts @@ -31,7 +31,7 @@ class Redis { if (this.initialized === true) return this.initialized = true - this.client = createClient(Redis.getRedisClient()) + this.client = createClient(Redis.getRedisClientOptions()) this.client.on('error', err => { logger.error('Error in Redis client.', { err }) @@ -45,7 +45,7 @@ class Redis { this.prefix = 'redis-' + WEBSERVER.HOST + '-' } - static getRedisClient () { + static getRedisClientOptions () { return Object.assign({}, (CONFIG.REDIS.AUTH && CONFIG.REDIS.AUTH != null) ? { password: CONFIG.REDIS.AUTH } : {}, (CONFIG.REDIS.DB) ? { db: CONFIG.REDIS.DB } : {}, @@ -55,6 +55,14 @@ class Redis { ) } + getClient () { + return this.client + } + + getPrefix () { + return this.prefix + } + /************* Forgot password *************/ async setResetPasswordVerificationString (userId: number) {