Sha256: 577d443205f3d3f5d0f64404c28f432e3485593cf3853141f3524317bb1a6785

Contents?: true

Size: 753 Bytes

Versions: 12

Compression:

Stored size: 753 Bytes

Contents

-module(ernie_server_sup).
-behaviour(supervisor).
-export([start_link/0, init/1]).

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

init([]) ->
  {ok, Port} = application:get_env(ernie_server_app, port),
  io:format("Using port ~p~n", [Port]),
  case application:get_env(ernie_server_app, pidfile) of
    {ok, Location} ->
      Pid = os:getpid(),
      ok = file:write_file(Location, list_to_binary(Pid));
    undefined -> ok
  end,
  {ok, Config} = application:get_env(ernie_server_app, config),
  {ok, Configs} = ernie_config:load(Config),
  io:format("~p~n", [Configs]),
  {ok, {{one_for_one, 1, 60},
    [{ernie_server, {ernie_server, start_link, [[Port, Configs]]},
    permanent, brutal_kill, worker, [ernie_server]}]}}.

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
ernie-2.5.2 elib/ernie_server_sup.erl
ernie-2.5.1 elib/ernie_server_sup.erl
ernie-2.5.0 elib/ernie_server_sup.erl
ernie-2.4.0 elib/ernie_server_sup.erl
ernie-2.3.0 elib/ernie_server_sup.erl
ernie-2.2.1 elib/ernie_server_sup.erl
schleyfox-ernie-2.2.3 elib/ernie_server_sup.erl
schleyfox-ernie-2.2.2 elib/ernie_server_sup.erl
schleyfox-ernie-2.2.1 elib/ernie_server_sup.erl
ernie-2.2.0 elib/ernie_server_sup.erl
ernie-2.1.0 elib/ernie_server_sup.erl
ernie-2.0.0 elib/ernie_server_sup.erl