diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-05-21 13:26:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-21 17:49:56 +0200 |
commit | 30c82f0d2e9adacc1d3398822aa7810c0ccbceb4 (patch) | |
tree | f24f7c978b0421d79d131b976ae36a826baa8d8c | |
parent | 2e8e97f313683bdf8a7448f3d1ba1f1c27f6ad50 (diff) | |
download | PeerTube-30c82f0d2e9adacc1d3398822aa7810c0ccbceb4.tar.gz PeerTube-30c82f0d2e9adacc1d3398822aa7810c0ccbceb4.tar.zst PeerTube-30c82f0d2e9adacc1d3398822aa7810c0ccbceb4.zip |
feature: db selection in redis
resolves #579
-rw-r--r-- | config/default.yaml | 1 | ||||
-rw-r--r-- | config/production.yaml.example | 1 | ||||
-rw-r--r-- | server/initializers/checker.ts | 2 | ||||
-rw-r--r-- | server/initializers/constants.ts | 3 | ||||
-rw-r--r-- | server/lib/job-queue/job-queue.ts | 3 | ||||
-rw-r--r-- | server/lib/redis.ts | 3 |
6 files changed, 9 insertions, 4 deletions
diff --git a/config/default.yaml b/config/default.yaml index 995638281..8a177e628 100644 --- a/config/default.yaml +++ b/config/default.yaml | |||
@@ -25,6 +25,7 @@ redis: | |||
25 | hostname: 'localhost' | 25 | hostname: 'localhost' |
26 | port: 6379 | 26 | port: 6379 |
27 | auth: null | 27 | auth: null |
28 | db: 0 | ||
28 | 29 | ||
29 | smtp: | 30 | smtp: |
30 | hostname: null | 31 | hostname: null |
diff --git a/config/production.yaml.example b/config/production.yaml.example index 71344fa35..51d5c5180 100644 --- a/config/production.yaml.example +++ b/config/production.yaml.example | |||
@@ -27,6 +27,7 @@ redis: | |||
27 | hostname: 'localhost' | 27 | hostname: 'localhost' |
28 | port: 6379 | 28 | port: 6379 |
29 | auth: null | 29 | auth: null |
30 | db: 0 | ||
30 | 31 | ||
31 | # SMTP server to send emails | 32 | # SMTP server to send emails |
32 | smtp: | 33 | smtp: |
diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts index c11dc7a89..5a9c603b5 100644 --- a/server/initializers/checker.ts +++ b/server/initializers/checker.ts | |||
@@ -22,7 +22,7 @@ function checkMissedConfig () { | |||
22 | 'webserver.https', 'webserver.hostname', 'webserver.port', | 22 | 'webserver.https', 'webserver.hostname', 'webserver.port', |
23 | 'trust_proxy', | 23 | 'trust_proxy', |
24 | 'database.hostname', 'database.port', 'database.suffix', 'database.username', 'database.password', | 24 | 'database.hostname', 'database.port', 'database.suffix', 'database.username', 'database.password', |
25 | 'redis.hostname', 'redis.port', 'redis.auth', | 25 | 'redis.hostname', 'redis.port', 'redis.auth', 'redis.db', |
26 | 'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address', | 26 | 'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address', |
27 | 'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache', | 27 | 'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache', |
28 | 'log.level', | 28 | 'log.level', |
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 51d272895..424947590 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -111,7 +111,8 @@ const CONFIG = { | |||
111 | REDIS: { | 111 | REDIS: { |
112 | HOSTNAME: config.get<string>('redis.hostname'), | 112 | HOSTNAME: config.get<string>('redis.hostname'), |
113 | PORT: config.get<number>('redis.port'), | 113 | PORT: config.get<number>('redis.port'), |
114 | AUTH: config.get<string>('redis.auth') | 114 | AUTH: config.get<string>('redis.auth'), |
115 | DB: config.get<number>('redis.db') | ||
115 | }, | 116 | }, |
116 | SMTP: { | 117 | SMTP: { |
117 | HOSTNAME: config.get<string>('smtp.hostname'), | 118 | HOSTNAME: config.get<string>('smtp.hostname'), |
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index acc69ef24..0333464bd 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts | |||
@@ -56,7 +56,8 @@ class JobQueue { | |||
56 | redis: { | 56 | redis: { |
57 | host: CONFIG.REDIS.HOSTNAME, | 57 | host: CONFIG.REDIS.HOSTNAME, |
58 | port: CONFIG.REDIS.PORT, | 58 | port: CONFIG.REDIS.PORT, |
59 | auth: CONFIG.REDIS.AUTH | 59 | auth: CONFIG.REDIS.AUTH, |
60 | db: CONFIG.REDIS.DB | ||
60 | } | 61 | } |
61 | }) | 62 | }) |
62 | 63 | ||
diff --git a/server/lib/redis.ts b/server/lib/redis.ts index 0acb9ff0e..97ff3598b 100644 --- a/server/lib/redis.ts +++ b/server/lib/redis.ts | |||
@@ -26,7 +26,8 @@ class Redis { | |||
26 | 26 | ||
27 | this.client = createClient({ | 27 | this.client = createClient({ |
28 | host: CONFIG.REDIS.HOSTNAME, | 28 | host: CONFIG.REDIS.HOSTNAME, |
29 | port: CONFIG.REDIS.PORT | 29 | port: CONFIG.REDIS.PORT, |
30 | db: CONFIG.REDIS.DB | ||
30 | }) | 31 | }) |
31 | 32 | ||
32 | this.client.on('error', err => { | 33 | this.client.on('error', err => { |