Skip to content

Commit

Permalink
use configuration endpoint for cluster in prod env
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull committed Dec 22, 2023
1 parent 73d7ed0 commit 8f7dc5c
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions config/runtime.exs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit 8f7dc5c

Please sign in to comment.