diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-06-05 17:11:54 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-06-05 17:11:54 +0100 |
| commit | 7be51e0fd9fb32369dc62400b2abb6a3e091d54b (patch) | |
| tree | e340720d8d2c38f05639c800b52859f9fc233ce2 /src | |
| parent | 7ee15f72a6a617f78c524169b99e73aed3fbc5ec (diff) | |
| download | rabbitmq-server-git-7be51e0fd9fb32369dc62400b2abb6a3e091d54b.tar.gz | |
Oops, we do need sync_notify - reinstate it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_event.erl | 21 | ||||
| -rw-r--r-- | src/rabbit_plugins.erl | 5 |
2 files changed, 21 insertions, 5 deletions
diff --git a/src/rabbit_event.erl b/src/rabbit_event.erl index b867223b50..a33103fd5a 100644 --- a/src/rabbit_event.erl +++ b/src/rabbit_event.erl @@ -23,6 +23,7 @@ ensure_stats_timer/3, stop_stats_timer/2, reset_stats_timer/2]). -export([stats_level/2, if_enabled/3]). -export([notify/2, notify/3, notify_if/3]). +-export([sync_notify/2, sync_notify/3]). %%---------------------------------------------------------------------------- @@ -61,6 +62,9 @@ -spec(notify/2 :: (event_type(), event_props()) -> 'ok'). -spec(notify/3 :: (event_type(), event_props(), reference() | 'none') -> 'ok'). -spec(notify_if/3 :: (boolean(), event_type(), event_props()) -> 'ok'). +-spec(sync_notify/2 :: (event_type(), event_props()) -> 'ok'). +-spec(sync_notify/3 :: (event_type(), event_props(), + reference() | 'none') -> 'ok'). -endif. @@ -145,7 +149,16 @@ notify_if(false, _Type, _Props) -> ok. notify(Type, Props) -> notify(Type, Props, none). notify(Type, Props, Ref) -> - gen_event:notify(?MODULE, #event{type = Type, - props = Props, - reference = Ref, - timestamp = os:timestamp()}). + gen_event:notify(?MODULE, event_cons(Type, Props, Ref)). + +sync_notify(Type, Props) -> sync_notify(Type, Props, none). + +sync_notify(Type, Props, Ref) -> + gen_event:sync_notify(?MODULE, event_cons(Type, Props, Ref)). + +event_cons(Type, Props, Ref) -> + #event{type = Type, + props = Props, + reference = Ref, + timestamp = os:timestamp()}. + diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index f6860424d0..2dffa6692e 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -47,7 +47,10 @@ disable(Plugins) -> RunningApps = rabbit_misc:which_applications(), ToDisable = [P || P <- Plugins, proplists:is_defined(P, RunningApps)], - ok = rabbit_event:notify(plugins_changed, [{disabled, ToDisable}]), + %% We need sync_notify here since mgmt will attempt to look at all + %% the modules for the disabled plugins - if they are unloaded + %% that won't work. + ok = rabbit_event:sync_notify(plugins_changed, [{disabled, ToDisable}]), rabbit:stop_apps(ToDisable). %% @doc Prepares the file system and installs all enabled plugins. |
