Skip to content

Commit

Permalink
Adapt to master, compile
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jul 2, 2016
1 parent dc7f333 commit 15b7b4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
11 changes: 4 additions & 7 deletions src/rabbit_connection_tracking.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@
tracked_connection_from_connection_created/1,
is_over_connection_limit/1, count_connections_in/1]).

-ifdef(use_specs).

-spec(register_connection/1 :: (rabbit_types:tracked_connection()) -> ok).
-spec(unregister_connection/1 :: (rabbit_types:connection_name()) -> ok).

-endif.

-include_lib("rabbit.hrl").

-define(TABLE, rabbit_tracked_connection).
Expand All @@ -45,6 +38,8 @@
%% API
%%

-spec register_connection(rabbit_types:tracked_connection()) -> ok.

register_connection(#tracked_connection{vhost = VHost} = Conn) ->
rabbit_misc:execute_mnesia_transaction(
fun() ->
Expand All @@ -54,6 +49,8 @@ register_connection(#tracked_connection{vhost = VHost} = Conn) ->
ok
end).

-spec unregister_connection(rabbit_types:connection_name()) -> ok.

unregister_connection(ConnId = {_Node, _Name}) ->
rabbit_misc:execute_mnesia_transaction(
fun() ->
Expand Down
7 changes: 2 additions & 5 deletions src/rabbit_connection_tracking_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
-export([init/1, handle_call/2, handle_event/2, handle_info/2,
terminate/2, code_change/3]).

-ifdef(use_specs).
-endif.

-include_lib("rabbit.hrl").

-rabbit_boot_step({?MODULE,
Expand Down Expand Up @@ -69,12 +66,12 @@ handle_event(#event{type = connection_closed, props = Details}, State) ->
proplists:get_value(name, Details)}),
{ok, State};
handle_event(#event{type = vhost_deleted, props = Details}, State) ->
VHost = proplists:get_value(name, Details),
_VHost = proplists:get_value(name, Details),
%% TODO: force close and unregister connections in
%% this vhost. Moved to rabbitmq/rabbitmq-server#627.
{ok, State};
handle_event(#event{type = user_deleted, props = Details}, State) ->
Username = proplists:get_value(name, Details),
_Username = proplists:get_value(name, Details),
%% TODO: force close and unregister connections from
%% this user. Moved to rabbitmq/rabbitmq-server#628.
{ok, State};
Expand Down

0 comments on commit 15b7b4e

Please sign in to comment.