Skip to content

Commit 5e8d4f1

Browse files
Merge pull request #2096 from tomyouyou/master
call "add_to_journal" before "maybe_flush_pre_publish_cache" in pre_publish
2 parents 2d67486 + dc2552b commit 5e8d4f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rabbit_queue_index.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,11 @@ pre_publish(MsgOrId, SeqId, MsgProps, IsPersistent, IsDelivered, JournalSizeHint
349349
DC
350350
end,
351351

352-
add_to_journal(SeqId, {IsPersistent, Bin, MsgBin},
353-
maybe_flush_pre_publish_cache(
352+
State2 = add_to_journal(SeqId, {IsPersistent, Bin, MsgBin}, State1),
353+
maybe_flush_pre_publish_cache(
354354
JournalSizeHint,
355-
State1#qistate{pre_publish_cache = PPC1,
356-
delivered_cache = DC1})).
355+
State2#qistate{pre_publish_cache = PPC1,
356+
delivered_cache = DC1}).
357357

358358
%% pre_publish_cache is the entry with most elements when compared to
359359
%% delivered_cache so we only check the former in the guard.

0 commit comments

Comments
 (0)