From 289ce855ad65b9e512ad9389a309e128d9dc79ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 8 Jun 2011 15:36:14 +0200 Subject: [PATCH] Use supervisor:child_spec() type where appropriate. --- src/egs_quests_sup.erl | 4 +++- src/egs_sup.erl | 6 +++--- src/egs_zones_sup.erl | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/egs_quests_sup.erl b/src/egs_quests_sup.erl index a961ae9..a240011 100644 --- a/src/egs_quests_sup.erl +++ b/src/egs_quests_sup.erl @@ -37,7 +37,9 @@ start_quest(UniID, QuestID) -> %% supervisor. --spec init([]) -> {ok, {{simple_one_for_one, 0, 1}, [{_, _, _, _, _, _}, ...]}}. +-spec init([]) -> {ok, {{simple_one_for_one, 0, 1}, [{egs_quests, + {egs_quests, start_link, []}, temporary, brutal_kill, + worker, [egs_quests]}]}}. init([]) -> {ok, {{simple_one_for_one, 0, 1}, [{egs_quests, {egs_quests, start_link, []}, temporary, brutal_kill, diff --git a/src/egs_sup.erl b/src/egs_sup.erl index cb56283..363e16c 100644 --- a/src/egs_sup.erl +++ b/src/egs_sup.erl @@ -27,7 +27,7 @@ start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []). --spec init([]) -> {ok, {{one_for_one, 10, 10}, [{_, _, _, _, _, _}, ...]}}. +-spec init([]) -> {ok, {{one_for_one, 10, 10}, [supervisor:child_spec(), ...]}}. init([]) -> Procs = procs([egs_conf, {sup, egs_quests_sup}, {sup, egs_zones_sup}, egs_accounts, egs_users, egs_seasons, egs_counters_db, egs_items_db, @@ -37,8 +37,8 @@ init([]) -> %% Internal. --spec procs([module()|{sup, module()}], [{_, _, _, _, _, _}]) - -> [{_, _, _, _, _, _}]. +-spec procs([module()|{sup, module()}], [supervisor:child_spec()]) + -> [supervisor:child_spec()]. procs([], Acc) -> lists:reverse(Acc); procs([{sup, Module}|Tail], Acc) -> diff --git a/src/egs_zones_sup.erl b/src/egs_zones_sup.erl index 75c54a6..298801d 100644 --- a/src/egs_zones_sup.erl +++ b/src/egs_zones_sup.erl @@ -38,7 +38,9 @@ start_zone(UniID, QuestID, ZoneID, ZoneData) -> %% supervisor. --spec init([]) -> {ok, {{simple_one_for_one, 0, 1}, [{_, _, _, _, _, _}, ...]}}. +-spec init([]) -> {ok, {{simple_one_for_one, 0, 1}, [{egs_zones, + {egs_zones, start_link, []}, temporary, brutal_kill, + worker, [egs_zones]}]}}. init([]) -> {ok, {{simple_one_for_one, 0, 1}, [{egs_zones, {egs_zones, start_link, []}, temporary, brutal_kill,