fix: date repositories from their state (#23)
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

Reviewed-on: #23
This commit was merged in pull request #23.
This commit is contained in:
2026-09-25 13:13:35 +00:00
parent 0ff6740a9e
commit da22d26019
5 changed files with 75 additions and 85 deletions
+10 -14
View File
@@ -1229,7 +1229,7 @@ impl Backend {
self.sync_progress = Some((0, 0));
cx.notify();
let progress_task: Task<Result<(), Error>> = cx.spawn(async move |this, cx| {
cx.spawn(async move |this, cx| {
let mut last_percent: u64 = 0;
while rx.changed().await.is_ok() {
@@ -1254,23 +1254,18 @@ impl Backend {
}
}
Ok(())
});
progress_task.detach();
Ok::<(), anyhow::Error>(())
})
.detach();
let sync = cx.background_spawn(async move {
let opts = SyncOptions::default().progress(tx);
sync_bootstrap_only(&client, filter, opts).await
});
let task: Task<Result<(), Error>> = cx.spawn(async move |this, cx| {
cx.spawn(async move |this, cx| {
match sync.await {
Ok(summary) => {
log::debug!(
"sync done: {} received, {} sent",
summary.received.len(),
summary.sent.len()
);
Ok(_) => {
this.update(cx, |this, cx| {
this.sync_progress = None;
cx.emit(BackendEvent::Synced);
@@ -1284,9 +1279,10 @@ impl Backend {
})?;
}
}
Ok(())
});
task.detach();
Ok::<(), anyhow::Error>(())
})
.detach();
}
/// Emit [`BackendEvent::Published`] for cross-store invalidation.