diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-10-03 15:20:47 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-10-03 15:20:47 +0100 |
commit | 9ce3e5c8b92b2cd4db5db3b1bd008918af6ea442 (patch) | |
tree | d00c3a9e5ca1e289ec45c9defc5b7064914dde64 /src/rabbit.erl | |
parent | 8d3f832d16e6d9e3e2a0982c4a90701eb3cc0cae (diff) | |
download | rabbitmq-server-9ce3e5c8b92b2cd4db5db3b1bd008918af6ea442.tar.gz |
Allow requires / enables to be multiple steps, reduce ugliness.
Diffstat (limited to 'src/rabbit.erl')
-rw-r--r-- | src/rabbit.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index cf45c562..a583779f 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -102,8 +102,7 @@ [{description, "guid generator"}, {mfa, {rabbit_sup, start_restartable_child, [rabbit_guid]}}, - {requires, rabbit_alarm}, %% transitive to node monitor - %% TODO ugly + {requires, kernel_ready}, {enables, core_initialized}]}). -rabbit_boot_step({delegate_sup, @@ -116,7 +115,7 @@ [{description, "node monitor"}, {mfa, {rabbit_sup, start_restartable_child, [rabbit_node_monitor]}}, - {requires, guid_generator}, + {requires, [rabbit_alarm, guid_generator]}, {enables, core_initialized}]}). -rabbit_boot_step({core_initialized, @@ -547,11 +546,15 @@ vertices({AppName, _Module, Steps}) -> [{StepName, {AppName, StepName, Atts}} || {StepName, Atts} <- Steps]. edges({_AppName, _Module, Steps}) -> + EnsureList = fun (L) when is_list(L) -> L; + (T) -> [T] + end, [case Key of requires -> {StepName, OtherStep}; enables -> {OtherStep, StepName} end || {StepName, Atts} <- Steps, - {Key, OtherStep} <- Atts, + {Key, OtherStepOrSteps} <- Atts, + OtherStep <- EnsureList(OtherStepOrSteps), Key =:= requires orelse Key =:= enables]. sort_boot_steps(UnsortedSteps) -> |