diff options
| author | Diana Corbacho <diana.corbacho@erlang-solutions.com> | 2015-10-26 12:47:36 +0000 |
|---|---|---|
| committer | Diana Corbacho <diana.corbacho@erlang-solutions.com> | 2015-10-26 12:52:50 +0000 |
| commit | 6581968166c18937807d39078e0690759d0e566f (patch) | |
| tree | 169dbec8aa73990b4edf5f98cae42c7462b91eda /src | |
| parent | 035347c4468d0b2d5f433a8e8dd6f41c25737b2c (diff) | |
| download | rabbitmq-server-git-6581968166c18937807d39078e0690759d0e566f.tar.gz | |
Disable disk monitor in unsupported platforms
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_disk_monitor.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/rabbit_disk_monitor.erl b/src/rabbit_disk_monitor.erl index 518000eb64..c65631a24c 100644 --- a/src/rabbit_disk_monitor.erl +++ b/src/rabbit_disk_monitor.erl @@ -40,7 +40,8 @@ min_interval, max_interval, timer, - alarmed + alarmed, + enabled }). %%---------------------------------------------------------------------------- @@ -96,7 +97,8 @@ init([Limit]) -> State = #state{dir = Dir, min_interval = ?DEFAULT_MIN_DISK_CHECK_INTERVAL, max_interval = ?DEFAULT_MAX_DISK_CHECK_INTERVAL, - alarmed = false}, + alarmed = false, + enabled = true}, case {catch get_disk_free(Dir), vm_memory_monitor:get_total_memory()} of {N1, N2} when is_integer(N1), is_integer(N2) -> @@ -104,12 +106,17 @@ init([Limit]) -> Err -> rabbit_log:info("Disabling disk free space monitoring " "on unsupported platform:~n~p~n", [Err]), - {stop, unsupported_platform} + {ok, State#state{enabled = false}} end. handle_call(get_disk_free_limit, _From, State = #state{limit = Limit}) -> {reply, Limit, State}; +handle_call({set_disk_free_limit, _}, _From, #state{enabled = false} = State) -> + rabbit_log:info("Cannot set disk free limit: " + "disabled disk free space monitoring", []), + {reply, ok, State}; + handle_call({set_disk_free_limit, Limit}, _From, State) -> {reply, ok, set_disk_limits(State, Limit)}; |
