Browse Source

Reduce env read duplication in config hierarchy

master
buttercat1791 2 months ago
parent
commit
51efa88a15
  1. 4
      config/config.exs
  2. 7
      config/dev.exs
  3. 2
      config/test.exs

4
config/config.exs

@ -12,8 +12,8 @@ config :gc_index_relay, @@ -12,8 +12,8 @@ config :gc_index_relay,
generators: [timestamp_type: :utc_datetime]
config :gc_index_relay, GcIndexRelay.Repo,
username: System.get_env("POSTGRES_ADMIN_USER"),
password: System.get_env("POSTGRES_ADMIN_PASSWORD"),
username: System.get_env("POSTGRES_USER"),
password: System.get_env("POSTGRES_PASSWORD"),
database: System.get_env("POSTGRES_DB"),
hostname: System.get_env("POSTGRES_HOST"),
stacktrace: true,

7
config/dev.exs

@ -2,11 +2,8 @@ import Config @@ -2,11 +2,8 @@ import Config
# Configure your database
config :gc_index_relay, GcIndexRelay.Repo,
username: System.get_env("POSTGRES_USER"),
password: System.get_env("POSTGRES_PASSWORD"),
database: System.get_env("POSTGRES_DB"),
hostname: System.get_env("POSTGRES_HOST"),
port: System.get_env("POSTGRES_PORT"),
username: System.get_env("POSTGRES_ADMIN_USER"),
password: System.get_env("POSTGRES_ADMIN_PASSWORD"),
stacktrace: true,
show_sensitive_data_on_connection_error: true,
pool_size: 10

2
config/test.exs

@ -10,8 +10,6 @@ config :gc_index_relay, :start_repo, true @@ -10,8 +10,6 @@ config :gc_index_relay, :start_repo, true
config :gc_index_relay, GcIndexRelay.Repo,
username: System.get_env("POSTGRES_USER"),
password: System.get_env("POSTGRES_PASSWORD"),
hostname: System.get_env("POSTGRES_HOST"),
port: System.get_env("POSTGRES_PORT"),
database: "#{System.get_env("POSTGRES_DB")}#{System.get_env("MIX_TEST_PARTITION")}",
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: System.schedulers_online() * 2

Loading…
Cancel
Save