seepur/config/redis.js

57 lines
1.5 KiB
JavaScript
Raw Normal View History

'use strict'
/*
|--------------------------------------------------------------------------
| Redis Configuaration
|--------------------------------------------------------------------------
|
| Here we define the configuration for redis server. A single application
| can make use of multiple redis connections using the redis provider.
|
*/
const Env = use('Env')
module.exports = {
/*
|--------------------------------------------------------------------------
| connection
|--------------------------------------------------------------------------
|
| Redis connection to be used by default.
|
*/
connection: Env.get('REDIS_CONNECTION', 'local'),
/*
|--------------------------------------------------------------------------
| local connection config
|--------------------------------------------------------------------------
|
| Configuration for a named connection.
|
*/
local: {
2020-05-18 00:50:26 +00:00
host: Env.get('REDIS_HOST', '127.0.0.1'),
port: Number(Env.get('REDIS_PORT', 6379)),
password: Env.get('REDIS_PASSWORD', null),
db: Number(Env.get('REDIS_DB', 0)),
keyPrefix: ''
},
/*
|--------------------------------------------------------------------------
| cluster config
|--------------------------------------------------------------------------
|
| Below is the configuration for the redis cluster.
|
*/
cluster: {
clusters: [
{host: '127.0.0.1', port: 6379, password: null, db: 0},
{host: '127.0.0.1', port: 6380, password: null, db: 0}
]
}
}