Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend/feat/adding-common-prefix-in-redis #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions app/gateway/src/App/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ data AppCfg = AppCfg
disableSignatureAuth :: Bool,
enablePrometheusMetricLogging :: Bool,
enableRedisLatencyLogging :: Bool,
internalEndPointMap :: M.Map BaseUrl BaseUrl
internalEndPointMap :: M.Map BaseUrl BaseUrl,
commonRedisPrefix :: Text
}
deriving (Generic, FromDhall)

Expand Down Expand Up @@ -109,16 +110,16 @@ buildAppEnv AppCfg {..} = do
shouldLogRequestId <- fromMaybe False . (>>= readMaybe) <$> lookupEnv "SHOULD_LOG_REQUEST_ID"
let kafkaProducerForART = Nothing
let modifierFunc = ("gateway:" <>)
hedisEnv <- Redis.connectHedis hedisCfg modifierFunc
hedisNonCriticalEnv <- Redis.connectHedis hedisNonCriticalCfg modifierFunc
hedisEnv <- Redis.connectHedis hedisCfg modifierFunc commonRedisPrefix
hedisNonCriticalEnv <- Redis.connectHedis hedisNonCriticalCfg modifierFunc commonRedisPrefix
hedisNonCriticalClusterEnv <-
if cutOffHedisCluster
then pure hedisNonCriticalEnv
else Redis.connectHedisCluster hedisNonCriticalClusterCfg modifierFunc
else Redis.connectHedisCluster hedisNonCriticalClusterCfg modifierFunc commonRedisPrefix
hedisClusterEnv <-
if cutOffHedisCluster
then pure hedisEnv
else Redis.connectHedisCluster hedisClusterCfg modifierFunc
else Redis.connectHedisCluster hedisClusterCfg modifierFunc commonRedisPrefix
let internalEndPointHashMap = HM.fromList $ M.toList internalEndPointMap
return $
AppEnv
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.