From 8f7dc5c05c3fad1232dec64622e1f6aff47818d7 Mon Sep 17 00:00:00 2001 From: Anthony Shull Date: Fri, 22 Dec 2023 08:09:15 -0600 Subject: [PATCH] use configuration endpoint for cluster in prod env --- config/runtime.exs | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/config/runtime.exs b/config/runtime.exs index 0187116e8f..a1492b6d01 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -1,12 +1,27 @@ import Config -config :cms, CMS.Cache, - conn_opts: [ - host: System.get_env("REDIS_HOST", "127.0.0.1"), - port: 6379 - ], - stats: false, - telemetry: false +if config_env() == :prod do + config :cms, CMS.Cache, + mode: :redis_cluster, + redis_cluster: [ + configuration_endpoints: [ + conn_opts: [ + host: System.get_env("REDIS_HOST", "127.0.0.1"), + port: 6379 + ] + ] + ], + stats: true, + telemetry: true +else + config :cms, CMS.Cache, + conn_opts: [ + host: System.get_env("REDIS_HOST", "127.0.0.1"), + port: 6379 + ], + stats: true, + telemetry: true +end if config_env() == :test do config :site, SiteWeb.Router,