@@ -187,9 +187,6 @@ defmodule Ecto.Repo.Supervisor do
187187
188188 @ doc false
189189 def init ( { name , repo , otp_app , adapter , opts } ) do
190- # Normalize name to atom, ignore via/global names
191- name = if is_atom ( name ) , do: name , else: nil
192-
193190 case init_config ( :supervisor , repo , otp_app , opts ) do
194191 { :ok , opts } ->
195192 :telemetry . execute (
@@ -199,6 +196,9 @@ defmodule Ecto.Repo.Supervisor do
199196 )
200197
201198 { :ok , child , meta } = adapter . init ( [ repo: repo ] ++ opts )
199+
200+ # Normalize name to atom, ignore via/global names
201+ name = if is_atom ( name ) , do: name , else: nil
202202 cache = Ecto.Query.Planner . new_query_cache ( name )
203203 meta = Map . merge ( meta , % { repo: repo , cache: cache } )
204204 child_spec = wrap_child_spec ( child , [ name , adapter , meta ] )
@@ -221,10 +221,6 @@ defmodule Ecto.Repo.Supervisor do
221221 end
222222 end
223223
224- defp wrap_child_spec ( { id , start , restart , shutdown , type , mods } , args ) do
225- { id , { __MODULE__ , :start_child , [ start | args ] } , restart , shutdown , type , mods }
226- end
227-
228224 defp wrap_child_spec ( % { start: start } = spec , args ) do
229225 % { spec | start: { __MODULE__ , :start_child , [ start | args ] } }
230226 end
0 commit comments