diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-01-14 19:09:50 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-01-14 19:09:50 +0000 |
commit | a68bae92ae0973323a1a39c214fac6413193ffd5 (patch) | |
tree | 67a583819169226903a46683795d9d4b3a2b75ab | |
parent | 4ea778db2bf033bed2f391f719fc11b39b3dbeba (diff) | |
download | rabbitmq-server-a68bae92ae0973323a1a39c214fac6413193ffd5.tar.gz |
Introduce msg_store_client_init/3 helper
-rw-r--r-- | src/rabbit_variable_queue.erl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index 3da5d6ae..c14d5b8a 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) -> |