diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2014-03-27 17:55:26 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2014-03-27 17:55:26 +0000 |
commit | db9dd2863e55474d89391e7d1a27185eac64b8ec (patch) | |
tree | f93f8cc91a848924f40500ce77a2e2df536a13aa | |
parent | 27a8dfe7920c73d18efee5a62cf9ee2dc74fc95c (diff) | |
download | rabbitmq-server-db9dd2863e55474d89391e7d1a27185eac64b8ec.tar.gz |
appease dialyzer
-rw-r--r-- | src/rabbit_queue_index.erl | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/rabbit_queue_index.erl b/src/rabbit_queue_index.erl index 3d0baac2..ad42ce6e 100644 --- a/src/rabbit_queue_index.erl +++ b/src/rabbit_queue_index.erl @@ -654,20 +654,15 @@ get_journal_handle(State = #qistate { journal_handle = Hdl }) -> %% Loading Journal. This isn't idempotent and will mess up the counts %% if you call it more than once on the same state. Assumes the counts %% are 0 to start with. -load_journal(State) -> - case is_journal_present(State) of +load_journal(State = #qistate { journal_handle = Hdl, dir = Dir }) -> + case (Hdl =/= undefined orelse + rabbit_file:is_file(filename:join(Dir, ?JOURNAL_FILENAME))) of true -> {JournalHdl, State1} = get_journal_handle(State), {ok, 0} = file_handle_cache:position(JournalHdl, 0), load_journal_entries(State1); false -> State end. -is_journal_present(#qistate { journal_handle = undefined, - dir = Dir }) -> - rabbit_file:is_file(filename:join(Dir, ?JOURNAL_FILENAME)); -is_journal_present(_) -> - true. - %% ditto recover_journal(State) -> State1 = #qistate { segments = Segments } = load_journal(State), |