summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2010-02-03 18:11:02 +0000
committerMatthew Sackman <matthew@lshift.net>2010-02-03 18:11:02 +0000
commitc63d1d6e35ef0abef0a62e8bb09cadc8d4bc4afa (patch)
tree5a3e24e019842905d6a7ebdf443096a2a1bb6a1b /src
parent0eea7dd180e51ca91e8a2d5bb8151e7a36b5fc34 (diff)
downloadrabbitmq-server-c63d1d6e35ef0abef0a62e8bb09cadc8d4bc4afa.tar.gz
Matthias-approved cosmetics
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue.erl28
-rw-r--r--src/rabbit_exchange.erl4
-rw-r--r--src/rabbit_exchange_type_direct.erl4
-rw-r--r--src/rabbit_exchange_type_fanout.erl4
-rw-r--r--src/rabbit_exchange_type_headers.erl4
-rw-r--r--src/rabbit_exchange_type_topic.erl4
6 files changed, 22 insertions, 26 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index 2c338516..bcea4c97 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -339,24 +339,20 @@ internal_delete(QueueName) ->
on_node_down(Node) ->
[Hook() ||
- Hook <-
- rabbit_misc:execute_mnesia_transaction(
- fun () ->
- qlc:fold(
- fun (QueueName, Acc) ->
- Post = rabbit_exchange:
- delete_transient_queue_bindings(QueueName),
- ok = mnesia:delete({rabbit_queue, QueueName}),
- [Post | Acc]
- end,
- [],
- qlc:q([QueueName ||
- #amqqueue{name = QueueName, pid = Pid}
- <- mnesia:table(rabbit_queue),
- node(Pid) == Node]))
- end)],
+ Hook <- rabbit_misc:execute_mnesia_transaction(
+ fun () ->
+ qlc:e(qlc:q([delete_queue(QueueName) ||
+ #amqqueue{name = QueueName, pid = Pid}
+ <- mnesia:table(rabbit_queue),
+ node(Pid) == Node]))
+ end)],
ok.
+delete_queue(QueueName) ->
+ Post = rabbit_exchange:delete_transient_queue_bindings(QueueName),
+ ok = mnesia:delete({rabbit_queue, QueueName}),
+ Post.
+
pseudo_queue(QueueName, Pid) ->
#amqqueue{name = QueueName,
durable = false,
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index 0734c083..29451fc9 100644
--- a/src/rabbit_exchange.erl
+++ b/src/rabbit_exchange.erl
@@ -516,8 +516,8 @@ conditional_delete(Exchange = #exchange{name = ExchangeName}) ->
%% result of a node failure
case contains(rabbit_route, Match) orelse
contains(rabbit_durable_route, Match) of
- true -> {error, in_use};
- false -> unconditional_delete(Exchange)
+ false -> unconditional_delete(Exchange);
+ true -> {error, in_use}
end.
unconditional_delete(Exchange = #exchange{name = ExchangeName}) ->
diff --git a/src/rabbit_exchange_type_direct.erl b/src/rabbit_exchange_type_direct.erl
index 7526dd66..deb8d76f 100644
--- a/src/rabbit_exchange_type_direct.erl
+++ b/src/rabbit_exchange_type_direct.erl
@@ -35,8 +35,8 @@
-behaviour(rabbit_exchange_type).
-export([description/0, publish/2]).
--export([validate/1, create/1, recover/2, delete/2, add_binding/2,
- delete_binding/2]).
+-export([validate/1, create/1, recover/2, delete/2,
+ add_binding/2, delete_binding/2]).
-include("rabbit_exchange_type_spec.hrl").
-rabbit_boot_step({?MODULE,
diff --git a/src/rabbit_exchange_type_fanout.erl b/src/rabbit_exchange_type_fanout.erl
index bef98897..deb8454f 100644
--- a/src/rabbit_exchange_type_fanout.erl
+++ b/src/rabbit_exchange_type_fanout.erl
@@ -35,8 +35,8 @@
-behaviour(rabbit_exchange_type).
-export([description/0, publish/2]).
--export([validate/1, create/1, recover/2, delete/2, add_binding/2,
- delete_binding/2]).
+-export([validate/1, create/1, recover/2, delete/2,
+ add_binding/2, delete_binding/2]).
-include("rabbit_exchange_type_spec.hrl").
-rabbit_boot_step({?MODULE,
diff --git a/src/rabbit_exchange_type_headers.erl b/src/rabbit_exchange_type_headers.erl
index 760e0a6e..af35071d 100644
--- a/src/rabbit_exchange_type_headers.erl
+++ b/src/rabbit_exchange_type_headers.erl
@@ -36,8 +36,8 @@
-behaviour(rabbit_exchange_type).
-export([description/0, publish/2]).
--export([validate/1, create/1, recover/2, delete/2, add_binding/2,
- delete_binding/2]).
+-export([validate/1, create/1, recover/2, delete/2,
+ add_binding/2, delete_binding/2]).
-include("rabbit_exchange_type_spec.hrl").
-rabbit_boot_step({?MODULE,
diff --git a/src/rabbit_exchange_type_topic.erl b/src/rabbit_exchange_type_topic.erl
index 1c8c8e11..2001371e 100644
--- a/src/rabbit_exchange_type_topic.erl
+++ b/src/rabbit_exchange_type_topic.erl
@@ -35,8 +35,8 @@
-behaviour(rabbit_exchange_type).
-export([description/0, publish/2]).
--export([validate/1, create/1, recover/2, delete/2, add_binding/2,
- delete_binding/2]).
+-export([validate/1, create/1, recover/2, delete/2,
+ add_binding/2, delete_binding/2]).
-include("rabbit_exchange_type_spec.hrl").
-rabbit_boot_step({?MODULE,