Skip to content

Commit

Permalink
Will smart restart apps after node crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ranok committed Mar 22, 2010
1 parent f14c03e commit 2c42dfa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/osp_manager.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ startup() ->
F = fun({App, Port}) ->
start_servlet(App, Port, node())
end,
lists:foreach(F, osp:get_conf('AUTO_STARTED')),
case lists:keyfind(node(), 1, nodeapp()) of
false ->
lists:foreach(F, osp:get_conf('AUTO_STARTED'));
{_, LocalApps} ->
lists:foreach(F, LocalApps)
end,
Pid = spawn(fun() -> loop() end),
{ok, Pid, osp_web:start()}.

Expand All @@ -61,7 +66,7 @@ loop() ->
loop()
end.

%% @doc The mnesia startup routine for osp_admin
%% @doc The mnesia startup routine for osp_manager
%% @spec start_mnesia() -> ok
start_mnesia() ->
case lists:member(mnesia_sup, erlang:registered()) of
Expand Down

0 comments on commit 2c42dfa

Please sign in to comment.