[erlang-questions] reload application configuration
Pierre Fenoll
pierrefenoll@REDACTED
Tue Nov 19 11:06:11 CET 2013
Hi,
Why not use functions defined in a conf module? Combined with hot code swapping that should do, shouldn't it?
Ah, maybe not with releases...
> On 11 nov. 2013, at 14:18, Benoit Chesneau <bchesneau@REDACTED> wrote:
>
> Hi all,
>
> Until now I was using either an ini file (using http://github.com/benoitc/econfig) to handle the config on my app. Econfig allows me to reload the config and update it in live relatively easily .
>
> But INI is a rather limited format and I don't really want to use something YAML or TOML. Instead I was thinking to use pur application config and maybe cuttlefish (https://github.com/basho/cuttlefish) . But I wonder how to change the config in live. Say for example having a an HTTP config handler that allows the user to change some settings, triggering the config changes in the applications and writing them on the disk. Is there a way to do that?
>
>
> I found an old mail that was suggestiing to use `application_controller:change_application_data` like this
>
>
> reload_config(AppNames, ConfigFile) ->
> {ok, [Config]} = file:consult(ConfigFile),
> Apps = [{application, A, element(2,application:get_all_key(A))}
> || {A,_,_} <- application:while_applications()],
> application_controller:change_application_data(Apps,Config).
>
>
> http://erlang.2086793.n4.nabble.com/Loading-application-variables-td2089610.html
>
> though `application_controller:change_application_data` is not public. Should I update the config using `application:set_env` instead? Any other way?
>
> - benoit
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20131119/0010133e/attachment.htm>
More information about the erlang-questions
mailing list