Skip to content

Commit ec8eb76

Browse files
committed
fix: sync instead of pull when not remote_writes
1 parent bbb52f8 commit ec8eb76

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

libsql/src/database/builder.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,15 @@ cfg_sync! {
656656
loop {
657657
tracing::trace!("trying to sync");
658658
let mut ctx = sync_ctx.lock().await;
659-
if let Err(e) = crate::sync::try_pull(&mut ctx, &conn).await {
660-
tracing::error!("sync error: {}", e);
659+
if remote_writes {
660+
if let Err(e) = crate::sync::try_pull(&mut ctx, &conn).await {
661+
tracing::error!("sync error: {}", e);
662+
}
663+
} else {
664+
if let Err(e) = crate::sync::sync_offline(&mut ctx, &conn).await {
665+
tracing::error!("sync error: {}", e);
666+
}
661667
}
662-
663668
tokio::time::sleep(sync_interval).await;
664669
}
665670
}

0 commit comments

Comments
 (0)