diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2011-10-15 12:27:36 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-10-15 12:27:36 +0100 |
| commit | a0fd784d7dbfbee544b91aef7fc4027cdd7a9701 (patch) | |
| tree | 782bcebdd77f57a89808dfef6bf02ebf2554e955 /src | |
| parent | 370a19c95af58bbb61d727fa7a9868adf698697c (diff) | |
| parent | 2c51116a998daa1c1a6314de0e942168eb1b70d9 (diff) | |
| download | rabbitmq-server-git-a0fd784d7dbfbee544b91aef7fc4027cdd7a9701.tar.gz | |
merge default into bug24308
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_msg_store.erl | 21 | ||||
| -rw-r--r-- | src/rabbit_plugins.erl | 2 |
2 files changed, 9 insertions, 14 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index f3056cd452..1a26a20048 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -1178,6 +1178,14 @@ safe_ets_update_counter(Tab, Key, UpdateOp, SuccessFun, FailThunk) -> catch error:badarg -> FailThunk() end. +update_msg_cache(CacheEts, MsgId, Msg) -> + case ets:insert_new(CacheEts, {MsgId, Msg, 1}) of + true -> ok; + false -> safe_ets_update_counter( + CacheEts, MsgId, {3, +1}, fun (_) -> ok end, + fun () -> update_msg_cache(CacheEts, MsgId, Msg) end) + end. + adjust_valid_total_size(File, Delta, State = #msstate { sum_valid_data = SumValid, file_summary_ets = FileSummaryEts }) -> @@ -1368,19 +1376,6 @@ list_sorted_file_names(Dir, Ext) -> filelib:wildcard("*" ++ Ext, Dir)). %%---------------------------------------------------------------------------- -%% message cache helper functions -%%---------------------------------------------------------------------------- - -update_msg_cache(CacheEts, MsgId, Msg) -> - case ets:insert_new(CacheEts, {MsgId, Msg, 1}) of - true -> true = undefined =/= Msg, %% ASSERTION - ok; - false -> safe_ets_update_counter( - CacheEts, MsgId, {3, +1}, fun (_) -> ok end, - fun () -> update_msg_cache(CacheEts, MsgId, Msg) end) - end. - -%%---------------------------------------------------------------------------- %% index %%---------------------------------------------------------------------------- diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index 27dadfc503..b06bcd8333 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -67,7 +67,7 @@ start() -> print_error("~p", [Reason]), rabbit_misc:quit(2); Other -> - print_error("~s", [Other]), + print_error("~p", [Other]), rabbit_misc:quit(2) end. |
