Skip to content

Commit 163e369

Browse files
committed
periodic checkpoint: Don't checkpoint at startup
Currently there's no way to disable checkpoint but one can emulate it by enabling periodic checkpoint with really long interval between checkpoints. Unfortunately, current implementation runs checkpoint first before waiting for the interval to pass. This change makes the periodic checkpoint to first wait and only after that checkpoint. Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
1 parent f8954db commit 163e369

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libsql-server/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ where
368368
tracing::info!("setting checkpoint interval to {:?}", period);
369369
let mut interval = interval(period);
370370
interval.set_missed_tick_behavior(MissedTickBehavior::Delay);
371+
// Make sure that we don't checkpoint immediately after startup
372+
interval.tick().await;
371373
let mut retry: Option<Duration> = None;
372374
loop {
373375
if let Some(retry) = retry.take() {

0 commit comments

Comments
 (0)