diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-05-19 12:41:22 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-05-19 12:41:22 +0100 |
| commit | d32b73f70c72ad41fd019ce0da80e47547d37982 (patch) | |
| tree | 8441f417b520f67f171bf9e5cae6d25938a56475 /src/rabbit.erl | |
| parent | a776cfe99bc3f582efcfb84a3976b492969a2206 (diff) | |
| download | rabbitmq-server-git-d32b73f70c72ad41fd019ce0da80e47547d37982.tar.gz | |
Fold refresh_config in with (un)set_env, abstract into rabbit.
Diffstat (limited to 'src/rabbit.erl')
| -rw-r--r-- | src/rabbit.erl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index e6e80b4aac..bbe987893b 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -25,6 +25,8 @@ -export([log_location/1]). +-export([get_env/1, set_env/2, unset_env/1]). + %%--------------------------------------------------------------------------- %% Boot steps. -export([maybe_insert_default_data/0, boot_delegate/0, recover/0]). @@ -186,6 +188,9 @@ -spec(maybe_insert_default_data/0 :: () -> 'ok'). -spec(boot_delegate/0 :: () -> 'ok'). -spec(recover/0 :: () -> 'ok'). +-spec(get_env/1 :: (atom()) -> any()). +-spec(set_env/2 :: (atom(), any()) -> 'ok'). +-spec(unset_env/1 :: (atom()) -> 'ok'). -endif. @@ -514,3 +519,14 @@ log_rotation_result(ok, {error, SaslLogError}) -> {error, {cannot_rotate_sasl_logs, SaslLogError}}; log_rotation_result(ok, ok) -> ok. + +get_env(Key) -> + application:get_env(rabbit, Key). + +set_env(Key, Value) -> + application:set_env(rabbit, Key, Value), + rabbit_channel:refresh_config_all(). + +unset_env(Key) -> + application:unset_env(rabbit, Key), + rabbit_channel:refresh_config_all(). |
