You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by iilyak <gi...@git.apache.org> on 2015/09/11 17:38:20 UTC

[GitHub] couchdb-couch-epi pull request: Use app env to specify list of plu...

GitHub user iilyak opened a pull request:

    https://github.com/apache/couchdb-couch-epi/pull/10

    Use app env to specify list of plugins

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloudant/couchdb-couch-epi synchronous_startup

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch-epi/pull/10.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #10
    
----
commit 30acd8eaf7fb416f44e2f9cc9462d09165e878a3
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2015-09-09T14:09:36Z

    Use app env to specify list of plugins

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-epi pull request: Use app env to specify list of plu...

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-epi/pull/10#discussion_r39284161
  
    --- Diff: src/couch_epi_sup.erl ---
    @@ -30,7 +30,13 @@
     %% ===================================================================
     
     start_link() ->
    -    supervisor:start_link({local, ?MODULE}, ?MODULE, []).
    +    case supervisor:start_link({local, ?MODULE}, ?MODULE, []) of
    +        {ok, _Pid} = Reply ->
    --- End diff --
    
    I'd rather see this over in the _app.erl file at https://github.com/apache/couchdb-couch-epi/blob/master/src/couch_epi_app.erl#L20
    
    This is about application startup, doing some work after the supervisor starts, rather than something about the supervisor itself.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-epi pull request: Use app env to specify list of plu...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb-couch-epi/pull/10#issuecomment-169416492
  
    Closing it since functionality is implemented using different means.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-epi pull request: Use app env to specify list of plu...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-epi/pull/10#discussion_r39285803
  
    --- Diff: src/couch_epi_sup.erl ---
    @@ -42,3 +48,36 @@ init([]) ->
             ?SUP(couch_epi_keeper_sup, [])
         ],
         {ok, { {one_for_one, 5, 10}, Children} }.
    +
    +%% ===================================================================
    +%% Internal functions definitions
    +%% ===================================================================
    +
    +start_plugins() ->
    +    Plugins = application:get_env(couch_epi, plugins, []),
    +    io:format(user, "PLUGS: ~p~n", [Plugins]),
    --- End diff --
    
    Remove this debug message


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-epi pull request: Use app env to specify list of plu...

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak closed the pull request at:

    https://github.com/apache/couchdb-couch-epi/pull/10


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-epi pull request: Use app env to specify list of plu...

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-epi/pull/10#discussion_r39284268
  
    --- Diff: src/couch_epi_sup.erl ---
    @@ -42,3 +48,36 @@ init([]) ->
             ?SUP(couch_epi_keeper_sup, [])
         ],
         {ok, { {one_for_one, 5, 10}, Children} }.
    +
    +%% ===================================================================
    +%% Internal functions definitions
    +%% ===================================================================
    +
    +start_plugins() ->
    +    Plugins = application:get_env(couch_epi, plugins, []),
    +    io:format(user, "PLUGS: ~p~n", [Plugins]),
    +    ensure_started(Plugins).
    +
    +ensure_started(Apps) ->
    +    start_applications(Apps, []).
    +
    +start_applications([], _Acc) ->
    +    ok;
    +start_applications([couch_epi|Apps], Acc) ->
    +    start_applications(Apps, Acc);
    +start_applications([App|Apps], Acc) ->
    +    case not lists:member(App, Acc) of
    +        true ->
    +            case application:start(App) of
    --- End diff --
    
    I'm not comfortable with starting applications here, given that should be taken care of by the erlang release mechanism. I can't think of an alternative right now but we should find one.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---