diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2015-01-13 10:55:02 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2015-01-13 10:55:02 +0000 |
| commit | 1ec1e79a2ecdaad03fa9335f74fbee3726eff79e (patch) | |
| tree | df9312a851842497505e823ac2432f9e890757dc /src | |
| parent | 7634d04f716b3bccff4a5bae9717119875371c2f (diff) | |
| download | rabbitmq-server-git-1ec1e79a2ecdaad03fa9335f74fbee3726eff79e.tar.gz | |
Rename this for a bit more clarity.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_variable_queue.erl | 4 | ||||
| -rw-r--r-- | src/truncate.erl | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index 8a1e52cfcd..d772d69bcc 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -1410,11 +1410,11 @@ determine_persist_to(Msg, #message_properties{size = Size}) -> %% The >= is so that you can set the env to 0 and never persist %% to the index. %% - %% We avoid invoking term_to_binary/1 if the message is large + %% We avoid invoking exceeds_size/2 if the message is large %% anyway. case Size >= IndexMaxSize of true -> msg_store; - false -> case truncate:term_limit(Msg, IndexMaxSize) of + false -> case truncate:exceeds_size(Msg, IndexMaxSize) of true -> msg_store; false -> queue_index end diff --git a/src/truncate.erl b/src/truncate.erl index 3e180a3aa7..952ed2443c 100644 --- a/src/truncate.erl +++ b/src/truncate.erl @@ -20,7 +20,7 @@ -record(params, {content, struct, content_dec, struct_dec}). --export([log_event/2, term/2, term_limit/2]). +-export([log_event/2, term/2, exceeds_size/2]). %% exported for testing -export([test/0]). @@ -45,7 +45,7 @@ report(List, Params) when is_list(List) -> [case Item of report(Other, Params) -> term(Other, Params). term(Thing, {Max, {Content, Struct, ContentDec, StructDec}}) -> - case term_limit(Thing, Max) of + case exceeds_size(Thing, Max) of true -> term(Thing, true, #params{content = Content, struct = Struct, content_dec = ContentDec, @@ -93,7 +93,7 @@ shrink_list([H|T], #params{content = Content, %% sizes. This is all going to be rather approximate though, these %% sizes are probably not very "fair" but we are just trying to see if %% we reach a fairly arbitrary limit anyway though. -term_limit(Thing, Max) -> +exceeds_size(Thing, Max) -> case term_size(Thing, Max, erlang:system_info(wordsize)) of limit_exceeded -> true; _ -> false |
