Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Moves db mod choice to env setting #18

Open
wants to merge 3 commits into
base: v0.3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ezic.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
kernel,
stdlib
]},
{mod, {ezic_app, ezic_db_ets}},
{env, [{db_dir, "db"}, {tzdata_dir, "priv/tzdata"}]}
{mod, {ezic_app, []}},
{env, [{db_mod, ezic_db_ets}, {db_dir, "db"}, {tzdata_dir, "priv/tzdata"}]}
]}.
10 changes: 8 additions & 2 deletions src/ezic_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@
%% OTP design principles as a supervision tree, this means starting the
%% top supervisor of the tree.
%%--------------------------------------------------------------------
start(_Type, StartArgs) ->
case ezic_sup:start_link(StartArgs) of

%% TODO: remove by 2013.09.07 (6 months from today), to allow time for
%% the transition
start(_Type, [_]) ->
erlang:error("Failed transition to v0.3.0: See Pull Request: https://github.com/drfloob/ezic/pull/15");
start(_Type, _StartArgs) ->
{ok, DbMod} = application:get_env(db_mod),
case ezic_sup:start_link(DbMod) of
{ok, Pid} ->
{ok, Pid};
Error ->
Expand Down