Skip to content

Commit

Permalink
Add if to read file only for central backend
Browse files Browse the repository at this point in the history
  • Loading branch information
agustinesco committed May 10, 2024
1 parent e9915db commit 2ff5f4c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
Expand Down

0 comments on commit 2ff5f4c

Please sign in to comment.