Commit 15fffc25 authored by Anuj Gupta's avatar Anuj Gupta
Browse files

Merge branch 'cherry-pick-fb2c21ed' into 'feature/anuj/ibm-cicd'

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

See merge request !12
parents 798d30b9 32267b96
Pipeline #25140 canceled with stages
in 9 minutes and 1 second
......@@ -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