Permalink
Browse files

Merge pull request #116 from basho/sdc-add-deregister

Add PB service deregistration on stop.
  • Loading branch information...
2 parents 4f1a184 + 32a1e7d commit e5775716d78e0e12bf31e087afac1bd548ebef48 @seancribbs seancribbs committed Aug 22, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −0 src/riak_search.app.src
  2. +4 −1 src/riak_search_app.erl
@@ -5,6 +5,7 @@
{applications, [
kernel,
stdlib,
+ riak_api,
riak_core,
riak_kv,
merge_index
@@ -11,6 +11,8 @@
%% Application callbacks
-export([start/2, stop/1]).
+-define(SERVICES, [{riak_search_pb_query, 27, 28}]).
+
%% ===================================================================
%% Application callbacks
%% ===================================================================
@@ -38,7 +40,7 @@ start(_StartType, _StartArgs) ->
Root = app_helper:get_env(riak_solr, solr_name, "solr"),
- ok = riak_api_pb_service:register(riak_search_pb_query, 27, 28),
+ ok = riak_api_pb_service:register(?SERVICES),
webmachine_router:add_route({[Root, index, "update"],
riak_solr_indexer_wm, []}),
@@ -57,4 +59,5 @@ start(_StartType, _StartArgs) ->
end.
stop(_State) ->
+ ok = riak_api_pb_service:deregister(?SERVICES),
ok.

0 comments on commit e577571

Please sign in to comment.