handle NewFile in sync servic to write in db

This commit is contained in:
boqiu 2024-10-23 19:00:47 +08:00 committed by Peter Zhang
parent e15143e0a4
commit 57ba8f9bb7

View File

@ -53,8 +53,15 @@ impl AutoSyncManager {
let catched_up = Arc::new(AtomicBool::new(false)); let catched_up = Arc::new(AtomicBool::new(false));
// handle new file // handle new file
let sync_store_cloned = sync_store.clone();
executor.spawn( executor.spawn(
Self::handle_new_file(new_file_recv, sync_store.clone()), async move {
while let Some(tx_seq) = new_file_recv.recv().await {
if let Err(err) = sync_store_cloned.insert(tx_seq, Queue::Ready).await {
warn!(?err, %tx_seq, "Failed to insert new file to ready queue");
}
}
},
"auto_sync_handle_new_file", "auto_sync_handle_new_file",
); );