diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2010-10-05 18:49:19 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2010-10-05 18:49:19 +0100 |
commit | 34aeb02852b5df3666d1c5827a9a580417ce97e6 (patch) | |
tree | 953c51487eca225d0f5d7292268ff54d3c2c89c0 | |
parent | a5e7c7afdbc73161cb40a1caffa647633d6a5db4 (diff) | |
download | rabbitmq-server-34aeb02852b5df3666d1c5827a9a580417ce97e6.tar.gz |
cosmetic
-rw-r--r-- | src/rabbit_msg_store.erl | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index 6c968ae4..5b308fe4 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -629,17 +629,16 @@ handle_cast({write, Guid}, not_found -> write_message(Guid, Msg, State); #msg_location { ref_count = 0, file = File, total_size = TotalSize } -> - [#file_summary { locked = Locked, - file_size = FileSize } = Summary] = - ets:lookup(FileSummaryEts, File), - case Locked of - true -> ok = index_delete(Guid, State), - write_message(Guid, Msg, State); - false -> ok = index_update_ref_count(Guid, 1, State), - ok = add_to_file_summary(Summary, TotalSize, FileSize, - State), - noreply(State #msstate { - sum_valid_data = SumValid + TotalSize }) + case ets:lookup(FileSummaryEts, File) of + [#file_summary { locked = true }] -> + ok = index_delete(Guid, State), + write_message(Guid, Msg, State); + [#file_summary { file_size = FileSize } = Summary] -> + ok = index_update_ref_count(Guid, 1, State), + ok = add_to_file_summary(Summary, TotalSize, FileSize, + State), + noreply(State #msstate { + sum_valid_data = SumValid + TotalSize }) end; #msg_location { ref_count = RefCount } -> %% We already know about it, just update counter. Only |