mirror of https://github.com/mastodon/mastodon
JS linting
This commit is contained in:
parent
7b7bf58a4c
commit
8ef6588749
|
@ -245,7 +245,7 @@ const redisConfigFromEnv = (env) => {
|
||||||
let redisDatabase = parseIntFromEnv(env.REDIS_DB, 0, 'REDIS_DB');
|
let redisDatabase = parseIntFromEnv(env.REDIS_DB, 0, 'REDIS_DB');
|
||||||
|
|
||||||
/** @type {import('ioredis').RedisOptions} */
|
/** @type {import('ioredis').RedisOptions} */
|
||||||
const redisParams = {
|
let redisParams = {
|
||||||
host: env.REDIS_HOST || '127.0.0.1',
|
host: env.REDIS_HOST || '127.0.0.1',
|
||||||
port: redisPort,
|
port: redisPort,
|
||||||
db: redisDatabase,
|
db: redisDatabase,
|
||||||
|
@ -253,16 +253,16 @@ const redisConfigFromEnv = (env) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (env.REDIS_SENTINEL) {
|
if (env.REDIS_SENTINEL) {
|
||||||
redisParams = {
|
redisParams = {
|
||||||
password: env.REDIS_PASSWORD || undefined,
|
password: env.REDIS_PASSWORD || undefined,
|
||||||
sentinels: env.REDIS_SENTINEL.split(',').map(h => {
|
sentinels: env.REDIS_SENTINEL.split(',').map(h => {
|
||||||
const s = h.split(':');
|
const s = h.split(':');
|
||||||
const host = s[0] || '127.0.0.1';
|
const host = s[0] || '127.0.0.1';
|
||||||
const port = s[1] || '26379';
|
const port = s[1] || '26379';
|
||||||
return { "host": host, "port": port };
|
return { "host": host, "port": port };
|
||||||
}),
|
}),
|
||||||
name: env.REDIS_SENTINEL_MASTER || 'mymaster',
|
name: env.REDIS_SENTINEL_MASTER || 'mymaster',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// redisParams.path takes precedence over host and port.
|
// redisParams.path takes precedence over host and port.
|
||||||
|
|
Loading…
Reference in New Issue