We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
remote_writes
1 parent bbb52f8 commit ec8eb76Copy full SHA for ec8eb76
1 file changed
libsql/src/database/builder.rs
@@ -656,10 +656,15 @@ cfg_sync! {
656
loop {
657
tracing::trace!("trying to sync");
658
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);
+ if remote_writes {
+ 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
666
667
}
-
668
tokio::time::sleep(sync_interval).await;
669
670
0 commit comments