diff options
author | Jerry Kuch <jerryk@vmware.com> | 2011-03-08 14:13:57 -0800 |
---|---|---|
committer | Jerry Kuch <jerryk@vmware.com> | 2011-03-08 14:13:57 -0800 |
commit | 57aac68bfb19700b2b7fc2ef5d79c2a884e797f8 (patch) | |
tree | 74ec5d7b8ec34ec11345678f8f031304fc6f5270 | |
parent | 096b7a553e5cfb599445cb1135d5d082d7c73304 (diff) | |
download | rabbitmq-server-57aac68bfb19700b2b7fc2ef5d79c2a884e797f8.tar.gz |
SQL-ize del_ps.
-rw-r--r-- | src/rabbit_mysql_queue.erl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rabbit_mysql_queue.erl b/src/rabbit_mysql_queue.erl index 07bddbd2..44390a48 100644 --- a/src/rabbit_mysql_queue.erl +++ b/src/rabbit_mysql_queue.erl @@ -807,11 +807,13 @@ add_p(M = #m { seq_id = SeqId }, #s { queue_name = DbQueueName }) -> del_ps(F, SeqIds, S = #s { queue_name = DbQueueName }) -> lists:foldl( fun( SeqId, Si) -> - %% FUCK: get p_record for this seq id - %% [#p_record { m = M }] = mnesia:read(PTable, SeqId, 'read'), - %% mysql_helper:delete_message_from_p_by_seq_id(SeqId), - %% F(M, Si) - F(Si) %% <-- GET RID OF ME! + DbList = mysql_helper:read_p_record(DbQueueName, SeqId), + [#p_record {m = M}] = emysql_util:as_record(DbList, + p_record, + record_info(fields, + p_record)), + mysql_helper:delete_message_from_p_by_seq_id(SeqId), + F(M, Si) end, S, SeqIds). |