summaryrefslogtreecommitdiff
path: root/src/catlfish_sup.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/catlfish_sup.erl')
-rw-r--r--src/catlfish_sup.erl13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/catlfish_sup.erl b/src/catlfish_sup.erl
index 5da7b93..3defec6 100644
--- a/src/catlfish_sup.erl
+++ b/src/catlfish_sup.erl
@@ -9,6 +9,16 @@
start_link(_Args) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+permanent_worker(Name, {Module, Function, Args}) ->
+ permanent_worker(Name, {Module, Function, Args}, [Module]).
+
+permanent_worker(Name, StartFunc, Modules) ->
+ {Name,
+ StartFunc,
+ permanent,
+ 10000,
+ worker, Modules}.
+
gen_http_config(Config, SSLOptions, SSLFlag) ->
{ChildName, IpAddress, Port, Module} = Config,
{ok, IPv4Address} =
@@ -39,4 +49,5 @@ init([]) ->
lager:debug("Starting servers ~p", [Servers]),
{ok,
{{one_for_one, 3, 10},
- Servers}}.
+ [permanent_worker(ratelimit, {ratelimit, start_link, []}) |
+ Servers]}}.