diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-01-14 18:59:54 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-01-14 18:59:54 +0000 |
commit | 6a1c228697e4bbefe2b54ab031640249869e1003 (patch) | |
tree | f9fadfcb7e40124f3058906e9869f328ad9d14fe | |
parent | 4ba8dcd22c786d8f14a359e0fffebdcbb9885875 (diff) | |
download | rabbitmq-server-6a1c228697e4bbefe2b54ab031640249869e1003.tar.gz |
change close_all_indicated to return {ok, CState}
-rw-r--r-- | src/rabbit_msg_store.erl | 10 | ||||
-rw-r--r-- | src/rabbit_variable_queue.erl | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index 611c2ce0..7eb0b34c 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -576,7 +576,7 @@ client_read3(#msg_location { guid = Guid, file = File }, Defer, case index_lookup(Guid, CState) of #msg_location { file = File } = MsgLocation -> %% Still the same file. - CState1 = close_all_indicated(CState), + {ok, CState1} = close_all_indicated(CState), %% We are now guaranteed that the mark_handle_open %% call will either insert_new correctly, or will %% fail, but find the value is open, not close. @@ -1266,10 +1266,10 @@ close_all_indicated(#client_msstate { file_handles_ets = FileHandlesEts, client_ref = Ref } = CState) -> Objs = ets:match_object(FileHandlesEts, {{Ref, '_'}, close}), - lists:foldl(fun ({Key = {_Ref, File}, close}, CStateM) -> - true = ets:delete(FileHandlesEts, Key), - close_handle(File, CStateM) - end, CState, Objs). + {ok, lists:foldl(fun ({Key = {_Ref, File}, close}, CStateM) -> + true = ets:delete(FileHandlesEts, Key), + close_handle(File, CStateM) + end, CState, Objs)}. close_all_handles(CState = #client_msstate { file_handles_ets = FileHandlesEts, file_handle_cache = FHC, diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index 4d56e48b..3da5d6ae 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -967,7 +967,7 @@ msg_store_sync(MSCState, IsPersistent, Guids, Callback) -> msg_store_close_fds(MSCState, IsPersistent) -> with_msg_store_state( MSCState, IsPersistent, - fun (MSCState1) -> {ok, rabbit_msg_store:close_all_indicated(MSCState1)} end). + fun (MSCState1) -> rabbit_msg_store:close_all_indicated(MSCState1) end). msg_store_close_fds_fun(IsPersistent) -> Self = self(), |