diff --git a/config/releases.exs b/config/releases.exs index f5ec0cbbc9..06197f891d 100644 --- a/config/releases.exs +++ b/config/releases.exs @@ -5,15 +5,20 @@ import Config # # See https://hexdocs.pm/mix/1.9.0/Mix.Tasks.Release.html#module-runtime-configuration -mandatory = fn env, exception -> - case System.get_env(env) do - nil -> throw(exception) - data -> data - end +mandatory = fn + env, exception, true, true -> + case System.get_env(env) do + nil -> throw(exception) + data -> data + end + env, exception, false, true -> + "WATCHER_INFO config in WATCHER SECURITY" end +watcher_info? = fn -> Code.ensure_loaded?(OMG.WatcherInfo) end + config :omg_watcher_info, OMG.WatcherInfo.DB.Repo, - url: mandatory.("DATABASE_URL", "DATABASE_URL needs to be set."), + url: mandatory.("DATABASE_URL", "DATABASE_URL needs to be set.", watcher_info?.(), true), # Have at most `:pool_size` DB connections on standby and serving DB queries. pool_size: String.to_integer(System.get_env("WATCHER_INFO_DB_POOL_SIZE") || "10"), # Wait at most `:queue_target` for a connection. If all connections checked out during