1
0
Fork 0

feature: db selection in redis

resolves #579
This commit is contained in:
Rigel Kent 2018-05-21 13:26:04 +02:00 committed by Chocobozzz
parent 2e8e97f313
commit 30c82f0d2e
6 changed files with 9 additions and 4 deletions

View File

@ -25,6 +25,7 @@ redis:
hostname: 'localhost'
port: 6379
auth: null
db: 0
smtp:
hostname: null

View File

@ -27,6 +27,7 @@ redis:
hostname: 'localhost'
port: 6379
auth: null
db: 0
# SMTP server to send emails
smtp:

View File

@ -22,7 +22,7 @@ function checkMissedConfig () {
'webserver.https', 'webserver.hostname', 'webserver.port',
'trust_proxy',
'database.hostname', 'database.port', 'database.suffix', 'database.username', 'database.password',
'redis.hostname', 'redis.port', 'redis.auth',
'redis.hostname', 'redis.port', 'redis.auth', 'redis.db',
'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address',
'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache',
'log.level',

View File

@ -111,7 +111,8 @@ const CONFIG = {
REDIS: {
HOSTNAME: config.get<string>('redis.hostname'),
PORT: config.get<number>('redis.port'),
AUTH: config.get<string>('redis.auth')
AUTH: config.get<string>('redis.auth'),
DB: config.get<number>('redis.db')
},
SMTP: {
HOSTNAME: config.get<string>('smtp.hostname'),

View File

@ -56,7 +56,8 @@ class JobQueue {
redis: {
host: CONFIG.REDIS.HOSTNAME,
port: CONFIG.REDIS.PORT,
auth: CONFIG.REDIS.AUTH
auth: CONFIG.REDIS.AUTH,
db: CONFIG.REDIS.DB
}
})

View File

@ -26,7 +26,8 @@ class Redis {
this.client = createClient({
host: CONFIG.REDIS.HOSTNAME,
port: CONFIG.REDIS.PORT
port: CONFIG.REDIS.PORT,
db: CONFIG.REDIS.DB
})
this.client.on('error', err => {