diff options
| author | Rob Harrop <rob@rabbitmq.com> | 2010-11-02 12:20:25 +0000 |
|---|---|---|
| committer | Rob Harrop <rob@rabbitmq.com> | 2010-11-02 12:20:25 +0000 |
| commit | 39a40495cc1e1243717be5f0a3fb0d5b82b3ac85 (patch) | |
| tree | 89d03f803746830ecf3c7f9571b8eb6c064b28f7 /src | |
| parent | e83a4f5690ae602b960542e06497d94388712bc0 (diff) | |
| parent | c3672b65a7a6ba70d2643c464a055bf379b61c85 (diff) | |
| download | rabbitmq-server-git-39a40495cc1e1243717be5f0a3fb0d5b82b3ac85.tar.gz | |
Merged bug23346 into default
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_plugin_activator.erl | 12 | ||||
| -rw-r--r-- | src/rabbit_variable_queue.erl | 29 |
2 files changed, 13 insertions, 28 deletions
diff --git a/src/rabbit_plugin_activator.erl b/src/rabbit_plugin_activator.erl index 88300ab448..ef81ddf23a 100644 --- a/src/rabbit_plugin_activator.erl +++ b/src/rabbit_plugin_activator.erl @@ -33,8 +33,6 @@ -export([start/0, stop/0]). --define(DefaultPluginDir, "plugins"). --define(DefaultUnpackedPluginDir, "priv/plugins"). -define(BaseApps, [rabbit]). %%---------------------------------------------------------------------------- @@ -56,8 +54,8 @@ start() -> application:load(rabbit), %% Determine our various directories - PluginDir = get_env(plugins_dir, ?DefaultPluginDir), - UnpackedPluginDir = get_env(plugins_expand_dir, ?DefaultUnpackedPluginDir), + {ok, PluginDir} = application:get_env(rabbit, plugins_dir), + {ok, UnpackedPluginDir} = application:get_env(rabbit, plugins_expand_dir), RootName = UnpackedPluginDir ++ "/rabbit", @@ -142,12 +140,6 @@ start() -> stop() -> ok. -get_env(Key, Default) -> - case application:get_env(rabbit, Key) of - {ok, V} -> V; - _ -> Default - end. - determine_version(App) -> application:load(App), {ok, Vsn} = application:get_key(App, vsn), diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index 9a33b57d1b..f88e49c2f9 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -229,7 +229,6 @@ len, persistent_count, - duration_target, target_ram_msg_count, ram_msg_count, ram_msg_count_prev, @@ -317,7 +316,6 @@ persistent_count :: non_neg_integer(), transient_threshold :: non_neg_integer(), - duration_target :: number() | 'infinity', target_ram_msg_count :: non_neg_integer() | 'infinity', ram_msg_count :: non_neg_integer(), ram_msg_count_prev :: non_neg_integer(), @@ -689,8 +687,7 @@ set_ram_duration_target(DurationTarget, infinity -> infinity; _ -> trunc(DurationTarget * Rate) %% msgs = sec * msgs/sec end, - State1 = State #vqstate { target_ram_msg_count = TargetRamMsgCount1, - duration_target = DurationTarget }, + State1 = State #vqstate { target_ram_msg_count = TargetRamMsgCount1 }, a(case TargetRamMsgCount1 == infinity orelse (TargetRamMsgCount =/= infinity andalso TargetRamMsgCount1 >= TargetRamMsgCount) of @@ -705,7 +702,6 @@ ram_duration(State = #vqstate { in_counter = InCount, out_counter = OutCount, ram_msg_count = RamMsgCount, - duration_target = DurationTarget, ram_msg_count_prev = RamMsgCountPrev }) -> Now = now(), {AvgEgressRate, Egress1} = update_rate(Now, Timestamp, OutCount, Egress), @@ -718,18 +714,16 @@ ram_duration(State = #vqstate { (2 * (AvgEgressRate + AvgIngressRate)) end, - {Duration, set_ram_duration_target( - DurationTarget, - State #vqstate { - rates = Rates #rates { - egress = Egress1, - ingress = Ingress1, - avg_egress = AvgEgressRate, - avg_ingress = AvgIngressRate, - timestamp = Now }, - in_counter = 0, - out_counter = 0, - ram_msg_count_prev = RamMsgCount })}. + {Duration, State #vqstate { + rates = Rates #rates { + egress = Egress1, + ingress = Ingress1, + avg_egress = AvgEgressRate, + avg_ingress = AvgIngressRate, + timestamp = Now }, + in_counter = 0, + out_counter = 0, + ram_msg_count_prev = RamMsgCount }}. needs_idle_timeout(State = #vqstate { on_sync = ?BLANK_SYNC }) -> {Res, _State} = reduce_memory_use(fun (_Quota, State1) -> State1 end, @@ -977,7 +971,6 @@ init(IsDurable, IndexState, DeltaCount, Terms, len = DeltaCount1, persistent_count = DeltaCount1, - duration_target = infinity, target_ram_msg_count = infinity, ram_msg_count = 0, ram_msg_count_prev = 0, |
