File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ defmodule LiveDebugger do
1414 @ assets_path "assets/live_debugger/client.js"
1515
1616 def start ( _type , _args ) do
17+ disabled? = Application . get_env ( @ app_name , :disabled? , false )
18+ children = if disabled? , do: [ ] , else: get_children ( )
19+ Supervisor . start_link ( children , strategy: :one_for_one , name: LiveDebugger.Supervisor )
20+ end
21+
22+ defp get_children ( ) do
1723 config = Application . get_all_env ( @ app_name )
1824
1925 put_endpoint_config ( config )
@@ -28,18 +34,15 @@ defmodule LiveDebugger do
2834 ] }
2935 ]
3036
31- children =
32- if LiveDebugger.Env . unit_test? ( ) do
33- children
34- else
35- children ++
36- [
37- { LiveDebugger.GenServers.CallbackTracingServer , [ ] } ,
38- { LiveDebugger.GenServers.EtsTableServer , [ ] }
39- ]
40- end
41-
42- Supervisor . start_link ( children , strategy: :one_for_one , name: LiveDebugger.Supervisor )
37+ if LiveDebugger.Env . unit_test? ( ) do
38+ children
39+ else
40+ children ++
41+ [
42+ { LiveDebugger.GenServers.CallbackTracingServer , [ ] } ,
43+ { LiveDebugger.GenServers.EtsTableServer , [ ] }
44+ ]
45+ end
4346 end
4447
4548 defp default_adapter ( ) do
You can’t perform that action at this time.
0 commit comments