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 | 44defd241f05505144e90f827f16cbf849664384 (patch) | |
| tree | 953c51487eca225d0f5d7292268ff54d3c2c89c0 | |
| parent | 367f9f0387a13da101c91355c41b79652b88d290 (diff) | |
| download | rabbitmq-server-git-44defd241f05505144e90f827f16cbf849664384.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 6c968ae451..5b308fe4ae 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 |
