USER_PASSWORD_RESET_LIFETIME,
VIDEO_VIEW_LIFETIME,
WEBSERVER
-} from '../initializers'
+} from '../initializers/constants'
import { CONFIG } from '../initializers/config'
type CachedRoute = {
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 })
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 } : {},
)
}
+ getClient () {
+ return this.client
+ }
+
+ getPrefix () {
+ return this.prefix
+ }
+
/************* Forgot password *************/
async setResetPasswordVerificationString (userId: number) {