Commit fb2c21ed authored by Anuj Gupta's avatar Anuj Gupta
Browse files

Merge branch '15-disable-redis-tls-flag' into 'ibm-impl'

Added config for REDIS TLS

See merge request !10
parents 874b57ef 181b51ce
......@@ -57,6 +57,9 @@ export abstract class Config implements IConfig {
// Unit Test activation flag
public static UTEST: string;
// Cache TLS DISABLE flag
public static CACHE_TLS_DISABLE: string;
// Service base configurations
public static SERVICE_ENV: string;
public static SERVICE_PORT: number;
......@@ -216,3 +219,6 @@ export class ConfigFactory extends CloudFactory {
// Set the Utest flag correctly as sooon as the config class get loaded
Config.UTEST = process.env.UTEST;
// Set the CACHE(REDIS) TLS DISABLE flag correctly. If not SET TLS is assume enabled so that change is non breaking
Config.CACHE_TLS_DISABLE = process.env.CACHE_TLS_DISABLE;
......@@ -37,12 +37,18 @@ export class Cache<T=string> {
this._redisClient =
Config.UTEST ?
require('redis-mock').createClient() :
connection.KEY ?
connection.KEY ? Config.CACHE_TLS_DISABLE ?
redis.createClient({
host: connection.ADDRESS,
port: connection.PORT,
auth_pass: connection.KEY,
tls: {servername: connection.ADDRESS}}) :
}) :
redis.createClient({
host: connection.ADDRESS,
port: connection.PORT,
auth_pass: connection.KEY,
tls: { servername: connection.ADDRESS }
}) :
redis.createClient({
host: connection.ADDRESS,
port: connection.PORT,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment