aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2024-03-01 13:22:14 +0000
committerGitHub <noreply@github.com>2024-03-01 13:22:14 +0000
commit291791ee3dc113c73793849f95b0126c52e6e761 (patch)
tree1e6a33d55d267b382aa780f04285f5cfe01a63ec
parentfeat: support regex with r/.../ syntax (#1745) (diff)
downloadatuin-291791ee3dc113c73793849f95b0126c52e6e761.zip
fix(sync): check store length after sync, not before (#1805)
-rw-r--r--atuin/src/command/client/sync.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/atuin/src/command/client/sync.rs b/atuin/src/command/client/sync.rs
index 03735eb5..4934baf4 100644
--- a/atuin/src/command/client/sync.rs
+++ b/atuin/src/command/client/sync.rs
@@ -88,6 +88,12 @@ async fn run(
let host_id = Settings::host_id().expect("failed to get host_id");
let history_store = HistoryStore::new(store.clone(), host_id, encryption_key);
+ let (uploaded, downloaded) = sync::sync(settings, &store).await?;
+
+ history_store.incremental_build(db, &downloaded).await?;
+
+ println!("{uploaded}/{} up/down to record store", downloaded.len());
+
let history_length = db.history_count(true).await?;
let store_history_length = store.len_tag("history").await?;
@@ -99,12 +105,6 @@ async fn run(
println!("\n");
}
-
- let (uploaded, downloaded) = sync::sync(settings, &store).await?;
-
- history_store.incremental_build(db, &downloaded).await?;
-
- println!("{uploaded}/{} up/down to record store", downloaded.len());
} else {
atuin_client::sync::sync(settings, force, db).await?;
}