<commit_before>-module(riak_pool_sup).

-behaviour(supervisor).

-export([start_link/0]).
-export([init/1]).

start_link() ->
  supervisor:start_link({local, ?MODULE}, ?MODULE, []).

init([]) ->
  {ok, Config} = application:get_env(riak_pool, pools),
  Processes = generate_workers(Config),
  Strategy = {one_for_one, 10, 10},
  {ok,
   {Strategy, lists:flatten(Processes)}}.

generate_workers(AggregateConfig) ->
  [config_to_spec(Conf) || Conf <- AggregateConfig].

config_to_spec({PoolName, PoolConfig}) ->
  Args = [{name, {local, PoolName}},
          {worker_module, riak_pool_worker} | PoolConfig],
  {PoolName, {poolboy, start_link, [Args]},
   permanent, 5000, worker, [poolboy]}.<commit_msg>riak pool does not crash whole node; manual application restart required.<commit_after>-module(riak_pool_sup).

-behaviour(supervisor).

-export([start_link/0]).
-export([init/1]).

start_link() ->
  supervisor:start_link({local, ?MODULE}, ?MODULE, []).

init([]) ->
  {ok, Config} = application:get_env(riak_pool, pools),
  Processes = generate_workers(Config),
  Strategy = {one_for_one, 10, 10},
  {ok,
   {Strategy, lists:flatten(Processes)}}.

generate_workers(AggregateConfig) ->
  [config_to_spec(Conf) || Conf <- AggregateConfig].

config_to_spec({PoolName, PoolConfig}) ->
  Args = [{name, {local, PoolName}},
          {worker_module, riak_pool_worker} | PoolConfig],
  {PoolName, {poolboy, start_link, [Args]},
   temporary, 5000, worker, [poolboy]}.
{'fraction_non_alphanumeric': 0.17647058823529413, 'fraction_numerical': 0.013679890560875513, 'mean_word_length': 5.252136752136752, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5485927', 'n_tokens_mistral': 539, 'n_tokens_neox': 517, 'n_words': 95}