fix: disable redis tls if undefined in config
This commit is contained in:
parent
0015afaca8
commit
2d4eda2c1d
4 changed files with 7 additions and 7 deletions
|
@ -20,11 +20,11 @@ export type Source = {
|
||||||
host: string;
|
host: string;
|
||||||
port: number;
|
port: number;
|
||||||
family?: number;
|
family?: number;
|
||||||
pass: string;
|
pass?: string;
|
||||||
db?: number;
|
db?: number;
|
||||||
prefix?: string;
|
prefix?: string;
|
||||||
user?: string;
|
user?: string;
|
||||||
tls?: { [x: string]: string };
|
tls?: { [y: string]: string };
|
||||||
};
|
};
|
||||||
elasticsearch: {
|
elasticsearch: {
|
||||||
host: string;
|
host: string;
|
||||||
|
|
|
@ -207,11 +207,11 @@ export const db = new DataSource({
|
||||||
host: config.redis.host,
|
host: config.redis.host,
|
||||||
port: config.redis.port,
|
port: config.redis.port,
|
||||||
family: config.redis.family == null ? 0 : config.redis.family,
|
family: config.redis.family == null ? 0 : config.redis.family,
|
||||||
user: config.redis.user ?? "default",
|
username: config.redis.user ?? "default",
|
||||||
password: config.redis.pass,
|
password: config.redis.pass,
|
||||||
keyPrefix: `${config.redis.prefix}:query:`,
|
keyPrefix: `${config.redis.prefix}:query:`,
|
||||||
db: config.redis.db || 0,
|
db: config.redis.db || 0,
|
||||||
tls: config.redis.tls || {},
|
tls: config.redis.tls,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: false,
|
: false,
|
||||||
|
|
|
@ -10,7 +10,7 @@ export function createConnection() {
|
||||||
username: config.redis.user ?? "default",
|
username: config.redis.user ?? "default",
|
||||||
keyPrefix: `${config.redis.prefix}:`,
|
keyPrefix: `${config.redis.prefix}:`,
|
||||||
db: config.redis.db || 0,
|
db: config.redis.db || 0,
|
||||||
tls: config.redis.tls || {},
|
tls: config.redis.tls,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,10 @@ export function initialize<T>(name: string, limitPerSec = -1) {
|
||||||
port: config.redis.port,
|
port: config.redis.port,
|
||||||
host: config.redis.host,
|
host: config.redis.host,
|
||||||
family: config.redis.family == null ? 0 : config.redis.family,
|
family: config.redis.family == null ? 0 : config.redis.family,
|
||||||
user: config.redis.user ?? "default",
|
username: config.redis.user ?? "default",
|
||||||
password: config.redis.pass,
|
password: config.redis.pass,
|
||||||
db: config.redis.db || 0,
|
db: config.redis.db || 0,
|
||||||
tls: config.redis.tls || {},
|
tls: config.redis.tls,
|
||||||
},
|
},
|
||||||
prefix: config.redis.prefix ? `${config.redis.prefix}:queue` : "queue",
|
prefix: config.redis.prefix ? `${config.redis.prefix}:queue` : "queue",
|
||||||
limiter:
|
limiter:
|
||||||
|
|
Loading…
Reference in a new issue