mirror of
https://github.com/valitydev/cache.git
synced 2024-11-06 01:45:19 +00:00
changes on default cache init
This commit is contained in:
parent
9a29b8ebf8
commit
699865d890
@ -27,7 +27,10 @@
|
||||
%%
|
||||
start_link() ->
|
||||
{ok, Sup} = supervisor:start_link({local, ?MODULE}, ?MODULE, []),
|
||||
lists:foreach(fun default_cache/1, default()),
|
||||
lists:foreach(
|
||||
fun default_cache/1,
|
||||
proplists:delete(included_applications, application:get_all_env())
|
||||
),
|
||||
{ok, Sup}.
|
||||
|
||||
init([]) ->
|
||||
@ -39,13 +42,7 @@ init([]) ->
|
||||
}.
|
||||
|
||||
%%
|
||||
%% create default caches
|
||||
default() ->
|
||||
case application:get_env(cache, default) of
|
||||
undefined -> [];
|
||||
{ok, Val} -> Val
|
||||
end.
|
||||
|
||||
%% create default cache
|
||||
default_cache({Name, Opts}) ->
|
||||
{ok, _} = supervisor:start_child(?MODULE, {
|
||||
Name,
|
||||
|
Loading…
Reference in New Issue
Block a user