Skip to content

Commit

Permalink
Avoid using application:get_env/3, since R15 doesn't have it
Browse files Browse the repository at this point in the history
  • Loading branch information
catamorphism committed Nov 3, 2014
1 parent b394ad3 commit e6220d1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/epna_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ start_pool(Name, Size, Timeout, ConnectFun, CloseFun) ->
init([]) ->
RestartStrategy = simple_one_for_one,

MaxR = application:get_env(episcina, max_restarts, 1000),
MaxT = application:get_env(episcina, max_seconds_between_restarts, 3600),
MaxR = get_env(max_restarts, 1000),
MaxT = get_env(max_seconds_between_restarts, 3600),

SupFlags = {RestartStrategy, MaxR, MaxT},

Expand All @@ -53,3 +53,11 @@ init([]) ->
%%%===================================================================
%%% Internal functions
%%%===================================================================

get_env(Key, Default) ->
case application:get_env(episcina, Key) of
undefined ->
Default;
{ok, Value} ->
Value
end.

0 comments on commit e6220d1

Please sign in to comment.