Skip to content

Commit b8b7e5a

Browse files
author
José Valim
committed
Start elixir and load config provider app holder
1 parent b65af04 commit b8b7e5a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/elixir/lib/config/provider.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ defmodule Config.Provider do
142142

143143
@doc false
144144
def boot(app, key, restart_fun \\ &System.restart/0) do
145+
# The app with the config provider settings may not
146+
# have been loaded at this point, so make sure we load
147+
# its environment before querying it.
148+
_ = :application.load(app)
149+
150+
# The config provider typically runs very early in the
151+
# release process, so we need to make sure Elixir is started
152+
# before we go around running Elixir code.
153+
{:ok, _} = :application.ensure_all_started(:elixir)
154+
145155
case :application.get_env(app, key) do
146156
{:ok, %Config.Provider{} = provider} ->
147157
path = resolve_config_path!(provider.config_path)

lib/elixir/lib/config/reader.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ defmodule Config.Reader do
2121

2222
@impl true
2323
def load(config, path) do
24-
{:ok, _} = Application.ensure_all_started(:elixir)
2524
merge(config, path |> Config.Provider.resolve_config_path!() |> read!())
2625
end
2726

0 commit comments

Comments
 (0)