Skip to content

Commit c4a54dd

Browse files
author
guyinyou
committed
fix
Change-Id: Id751e63ddd20ca6223d83d8057623f19e54fa3ca
1 parent bcd8268 commit c4a54dd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

store/src/main/java/org/apache/rocketmq/store/timer/TimerMessageStore.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,10 +1840,14 @@ public void flush() throws IOException {
18401840
synchronized (lockWhenFlush) {
18411841
prepareTimerCheckPoint();
18421842
timerLog.getMappedFileQueue().flush(0);
1843-
if (System.currentTimeMillis() - lastSnapshotTime > storeConfig.getTimerWheelSnapshotIntervalMs()) {
1844-
lastSnapshotTime = System.currentTimeMillis();
1845-
timerWheel.backup(timerLog.getMappedFileQueue().getFlushedWhere());
1846-
timerCheckpoint.flush();
1843+
if (storeConfig.isTimerWheelSnapshotFlush()) {
1844+
if (System.currentTimeMillis() - lastSnapshotTime > storeConfig.getTimerWheelSnapshotIntervalMs()) {
1845+
lastSnapshotTime = System.currentTimeMillis();
1846+
timerWheel.backup(timerLog.getMappedFileQueue().getFlushedWhere());
1847+
timerCheckpoint.flush();
1848+
}
1849+
} else {
1850+
timerWheel.flush();
18471851
}
18481852
}
18491853
if (System.currentTimeMillis() - start > storeConfig.getTimerProgressLogIntervalMs()) {

0 commit comments

Comments
 (0)