summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-01-14 19:09:50 +0000
committerMatthew Sackman <matthew@rabbitmq.com>2011-01-14 19:09:50 +0000
commit0f34fc96e7a58c44cf292fe914ef129624822e69 (patch)
tree67a583819169226903a46683795d9d4b3a2b75ab /src
parent352224998317eef0065da02cbe88b5438487c67c (diff)
downloadrabbitmq-server-git-0f34fc96e7a58c44cf292fe914ef129624822e69.tar.gz
Introduce msg_store_client_init/3 helper
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_variable_queue.erl15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index 3da5d6ae43..c14d5b8a5b 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -436,12 +436,10 @@ init(QueueName, true, true, MsgOnDiskFun, MsgIdxOnDiskFun) ->
Terms};
_ -> {rabbit_guid:guid(), rabbit_guid:guid(), []}
end,
- PersistentClient = rabbit_msg_store:client_init(
- ?PERSISTENT_MSG_STORE, PRef, MsgOnDiskFun,
- msg_store_close_fds_fun(true)),
- TransientClient = rabbit_msg_store:client_init(
- ?TRANSIENT_MSG_STORE, TRef, undefined,
- msg_store_close_fds_fun(false)),
+ PersistentClient = msg_store_client_init(
+ ?PERSISTENT_MSG_STORE, PRef, MsgOnDiskFun),
+ TransientClient = msg_store_client_init(
+ ?TRANSIENT_MSG_STORE, TRef, undefined),
{DeltaCount, IndexState} =
rabbit_queue_index:recover(
QueueName, Terms1,
@@ -935,8 +933,11 @@ with_immutable_msg_store_state(MSCState, IsPersistent, Fun) ->
Res.
msg_store_client_init(MsgStore, MsgOnDiskFun) ->
+ msg_store_client_init(MsgStore, rabbit_guid:guid(), MsgOnDiskFun).
+
+msg_store_client_init(MsgStore, Ref, MsgOnDiskFun) ->
rabbit_msg_store:client_init(
- MsgStore, rabbit_guid:guid(), MsgOnDiskFun,
+ MsgStore, Ref, MsgOnDiskFun,
msg_store_close_fds_fun(MsgStore =:= ?PERSISTENT_MSG_STORE)).
msg_store_write(MSCState, IsPersistent, Guid, Msg) ->