Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
{deps_dir, "deps"}.

{deps, [
{lager, "2.0.1",
{git, "git://github.com/basho/lager.git",
{tag, "2.0.1"}}}
{lager, ".*",
{git, "git://github.com/erlang-lager/lager.git",
{tag, "3.2.4"}}}
]}.

{eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}.
Expand Down
21 changes: 14 additions & 7 deletions src/superman.erl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ reconfigure_supervisor(SupName, Specs) ->

{Deleted, New, Changed, _Unchanged} = extract_children(SupName, Specs),
reconfigure_supervisor_ll(SupName, Deleted, New, Changed, 0).

start_children(Module, Config) ->
start_children(Module, Module, Config).

Expand Down Expand Up @@ -76,11 +76,18 @@ reconfigure_supervisor_tree(SupName, Specs) ->
%%%======================================================

get_supervisor_state(SupPid) ->
{status, _Pid, {module, _Mod},
{status, _Pid, {module, _Mod},
[_PDict, _SysState, _Parent, _Dbg, Misc]} = sys:get_status(SupPid),
case Misc of
[_Name, State1, _Type, _Time] -> State1;
[_Header, _Data, {data, [{"State", State2}]}] -> State2

%% loop through all data keys in the misc status
case lists:filtermap(fun(Data) ->
case proplists:get_value("State", Data) of
undefined -> false;
State -> {true, State}
end
end, proplists:get_all_values(data, Misc)) of
[] -> undefined;
[State] -> State
end.

reconfigure_supervisor_ll(SupName, Deleted, New, Changed, N) ->
Expand Down Expand Up @@ -287,6 +294,6 @@ change_specs(Specs) ->
lists:map(fun change_spec/1, Specs).

change_spec({Id, MFA, _RestartType, Timeout, Type, Modules}) ->
{Id, MFA, some_type, Timeout, Type, Modules}.
{Id, MFA, some_type, Timeout, Type, Modules}.

-endif.