aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ranch_sup.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ranch_sup.erl b/src/ranch_sup.erl
index f5bf82e..3cb0cd6 100644
--- a/src/ranch_sup.erl
+++ b/src/ranch_sup.erl
@@ -23,10 +23,18 @@ start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
+ Intensity = case application:get_env(ranch_sup_intensity) of
+ {ok, Value1} -> Value1;
+ undefined -> 1
+ end,
+ Period = case application:get_env(ranch_sup_period) of
+ {ok, Value2} -> Value2;
+ undefined -> 5
+ end,
ranch_server = ets:new(ranch_server, [
ordered_set, public, named_table]),
Procs = [
{ranch_server, {ranch_server, start_link, []},
permanent, 5000, worker, [ranch_server]}
],
- {ok, {{one_for_one, 1, 5}, Procs}}.
+ {ok, {{one_for_one, Intensity, Period}, Procs}}.