Skip to content

Commit 8219e43

Browse files
author
Devdutt Shenoi
committed
fix: sync with two threads
1 parent e4ca566 commit 8219e43

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sync.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ where
7474

7575
/// Flushes arrows onto disk every `LOCAL_SYNC_INTERVAL` seconds, packs arrows into parquet every
7676
/// `STORAGE_CONVERSION_INTERVAL` secondsand uploads them every `STORAGE_UPLOAD_INTERVAL` seconds.
77-
#[tokio::main(flavor = "current_thread")]
77+
#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
7878
pub async fn handler(mut cancel_rx: oneshot::Receiver<()>) -> anyhow::Result<()> {
7979
let (localsync_handler, mut localsync_outbox, localsync_inbox) = local_sync();
8080
let (mut remote_sync_handler, mut remote_sync_outbox, mut remote_sync_inbox) =
@@ -86,10 +86,10 @@ pub async fn handler(mut cancel_rx: oneshot::Receiver<()>) -> anyhow::Result<()>
8686
remote_sync_inbox.send(()).unwrap_or(());
8787
localsync_inbox.send(()).unwrap_or(());
8888
if let Err(e) = localsync_handler.await {
89-
error!("Error joining remote_sync_handler: {:?}", e);
89+
error!("Error joining remote_sync_handler: {e:?}");
9090
}
9191
if let Err(e) = remote_sync_handler.await {
92-
error!("Error joining remote_sync_handler: {:?}", e);
92+
error!("Error joining remote_sync_handler: {e:?}");
9393
}
9494
return Ok(());
9595
},
@@ -101,7 +101,7 @@ pub async fn handler(mut cancel_rx: oneshot::Receiver<()>) -> anyhow::Result<()>
101101
_ = &mut remote_sync_outbox => {
102102
// remote_sync failed, this is recoverable by just starting remote_sync thread again
103103
if let Err(e) = remote_sync_handler.await {
104-
error!("Error joining remote_sync_handler: {:?}", e);
104+
error!("Error joining remote_sync_handler: {e:?}");
105105
}
106106
(remote_sync_handler, remote_sync_outbox, remote_sync_inbox) = object_store_sync();
107107
},
@@ -212,7 +212,7 @@ pub fn local_sync() -> (
212212
future.await;
213213
}
214214
Err(panic_error) => {
215-
error!("Panic in local sync task: {:?}", panic_error);
215+
error!("Panic in local sync task: {panic_error:?}");
216216
}
217217
}
218218

0 commit comments

Comments
 (0)