feat: accept username, password, tls for redis configuration
This commit is contained in:
@@ -1,9 +1,24 @@
|
||||
import appConfig from './app';
|
||||
|
||||
const redisConfig = {
|
||||
type TRedisConfig = {
|
||||
host: string,
|
||||
port: number,
|
||||
username?: string,
|
||||
password?: string,
|
||||
tls?: Record<string, unknown>,
|
||||
enableOfflineQueue: boolean,
|
||||
}
|
||||
|
||||
const redisConfig: TRedisConfig = {
|
||||
host: appConfig.redisHost,
|
||||
port: appConfig.redisPort,
|
||||
username: appConfig.redisUsername,
|
||||
password: appConfig.redisPassword,
|
||||
enableOfflineQueue: false,
|
||||
};
|
||||
|
||||
if (appConfig.redisTls) {
|
||||
redisConfig.tls = {};
|
||||
}
|
||||
|
||||
export default redisConfig;
|
||||
|
Reference in New Issue
Block a user