Skip to content

Commit

Permalink
application reconfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
lazedo committed Mar 2, 2016
1 parent 8231407 commit ad866a2
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 117 deletions.
23 changes: 0 additions & 23 deletions core/kazoo_couch/src/kazoo_couch.erl
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
-module(kazoo_couch).

-behaviour(application).
-behaviour(kz_data).

-include("kz_couch.hrl").

%% Application callbacks
-export([start/2, stop/1]).

%% Driver callbacks
-export([new_connection/1
,format_error/1
Expand Down Expand Up @@ -59,25 +55,6 @@
,all_docs/3
]).

%% ===================================================================
%% Application callbacks
%% ===================================================================
%%--------------------------------------------------------------------
%% @public
%% @doc Implement the application start behaviour
%%--------------------------------------------------------------------
-spec start(application:start_type(), any()) -> startapp_ret().
start(_StartType, _StartArgs) ->
kazoo_couch_sup:start_link().

%%--------------------------------------------------------------------
%% @public
%% @doc Implement the application stop behaviour
%%--------------------------------------------------------------------
-spec stop(any()) -> any().
stop(_State) ->
'ok'.

%% Server operations
new_connection(Map) ->
kz_couch_util:new_connection(Map).
Expand Down
65 changes: 0 additions & 65 deletions core/kazoo_couch/src/kazoo_couch_sup.erl

This file was deleted.

4 changes: 2 additions & 2 deletions core/kazoo_data/src/kazoo_data.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
,{id, "108013a5-95e7-4e18-5757-344d22bebce8"}
,{vsn, "4.0.0"}
,{modules, []}
,{registered, []}
,{registered, [kazoo_data_app, kazoo_data_sup]}
,{applications, [ kernel
, stdlib
, crypto
Expand All @@ -13,5 +13,5 @@
, whistle_config
, whistle_amqp
]}
,{mod, {kazoo_data, []}}
,{mod, {kazoo_data_app, []}}
]}.
23 changes: 0 additions & 23 deletions core/kazoo_data/src/kazoo_data.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
-module(kazoo_data).

-behaviour(application).

-include("kz_data.hrl").

-export_type([db_create_options/0
Expand All @@ -12,24 +10,3 @@
,view_options/0
]).

%% Application callbacks
-export([start/2, stop/1]).

%% ===================================================================
%% Application callbacks
%% ===================================================================
%%--------------------------------------------------------------------
%% @public
%% @doc Implement the application start behaviour
%%--------------------------------------------------------------------
-spec start(application:start_type(), any()) -> startapp_ret().
start(_StartType, _StartArgs) ->
kazoo_data_sup:start_link().

%%--------------------------------------------------------------------
%% @public
%% @doc Implement the application stop behaviour
%%--------------------------------------------------------------------
-spec stop(any()) -> any().
stop(_State) ->
'ok'.
27 changes: 27 additions & 0 deletions core/kazoo_data/src/kazoo_data_app.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-module(kazoo_data_app).

-behaviour(application).

-include("kz_data.hrl").

%% Application callbacks
-export([start/2, stop/1]).

%% ===================================================================
%% Application callbacks
%% ===================================================================
%%--------------------------------------------------------------------
%% @public
%% @doc Implement the application start behaviour
%%--------------------------------------------------------------------
-spec start(application:start_type(), any()) -> startapp_ret().
start(_StartType, _StartArgs) ->
kazoo_data_sup:start_link().

%%--------------------------------------------------------------------
%% @public
%% @doc Implement the application stop behaviour
%%--------------------------------------------------------------------
-spec stop(any()) -> any().
stop(_State) ->
'ok'.
16 changes: 12 additions & 4 deletions core/kazoo_data/src/kzs_plan.erl
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,22 @@ get_dataplan(DBName, DocType) ->
system_dataplan() ->
#{tag => 'local', server => kz_dataconnections:get_server(server_tag())}.

account_dataplan(_DBName) ->
account_dataplan(AccountDb) ->
AccountId = wh_util:format_account_id(AccountDb),
lager:debug("ACCOUNT ID IS ~p", [AccountId]),
#{tag => 'local', server => kz_dataconnections:get_server(server_tag())}.

account_dataplan(_DBName, _DocType) ->
account_dataplan(AccountDb, _DocType) ->
AccountId = wh_util:format_account_id(AccountDb),
lager:debug("ACCOUNT ID IS ~p", [AccountId]),
#{tag => 'local', server => kz_dataconnections:get_server(server_tag())}.

account_modb_dataplan(_DBName) ->
account_modb_dataplan(AccountMODB) ->
AccountId = wh_util:format_account_id(AccountMODB),
lager:debug("ACCOUNT ID IS ~p", [AccountId]),
#{tag => 'local', server => kz_dataconnections:get_server(server_tag())}.

account_modb_dataplan(_DBName, _DocType) ->
account_modb_dataplan(AccountMODB, _DocType) ->
AccountId = wh_util:format_account_id(AccountMODB),
lager:debug("ACCOUNT ID IS ~p", [AccountId]),
#{tag => 'local', server => kz_dataconnections:get_server(server_tag())}.

0 comments on commit ad866a2

Please sign in to comment.