mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-12 14:12:30 +01:00
Merge branch 'moreopts' into 'master'
add env for redis pwd and port See merge request timvisee/send!14
This commit is contained in:
commit
eeb1359d90
@ -64,6 +64,16 @@ const conf = convict({
|
||||
default: 'localhost',
|
||||
env: 'REDIS_HOST'
|
||||
},
|
||||
redis_port: {
|
||||
format: Number,
|
||||
default: 6379,
|
||||
env: 'REDIS_PORT'
|
||||
},
|
||||
redis_password: {
|
||||
format: String,
|
||||
default: '',
|
||||
env: 'REDIS_PASSWORD'
|
||||
},
|
||||
redis_event_expire: {
|
||||
format: Boolean,
|
||||
default: false,
|
||||
|
@ -10,6 +10,8 @@ module.exports = function(config) {
|
||||
const redis = require(redis_lib);
|
||||
const client = redis.createClient({
|
||||
host: config.redis_host,
|
||||
port: config.redis_port,
|
||||
password: config.redis_password,
|
||||
retry_strategy: options => {
|
||||
if (options.total_retry_time > config.redis_retry_time) {
|
||||
client.emit('error', 'Retry time exhausted');
|
||||
|
Loading…
Reference in New Issue
Block a user