From 2ff5f4cce75e176b0aa0699f57b6f518fde0e027 Mon Sep 17 00:00:00 2001 From: agustinesco Date: Fri, 10 May 2024 17:54:57 -0300 Subject: [PATCH] Add if to read file only for central backend --- config/runtime.exs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/config/runtime.exs b/config/runtime.exs index d8554dde5..b51efc546 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -137,17 +137,14 @@ end ################################### # App configuration: game_backend # ################################### -{:ok, currency_config_json} = - Application.app_dir(:game_backend, "priv/currencies_rules.json") - |> File.read() -config :game_backend, :currencies_config, Jason.decode!(currency_config_json) +if System.get_env("RELEASE") == :central_backend or config_env() == :dev do + {:ok, currency_config_json} = + "./apps/game_backend/priv/currencies_rules.json" + |> File.read() -{:ok, currency_config_json} = - "./apps/game_backend/priv/currencies_rules.json" - |> File.read() - -config :game_backend, :currencies_config, Jason.decode!(currency_config_json) + config :game_backend, :currencies_config, Jason.decode!(currency_config_json) +end ################################## # App configuration: game_client #