summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2024-03-06 15:16:07 +0000
committerGitHub <noreply@github.com>2024-03-06 15:16:07 +0000
commitf943e03f905f09ad71e234974a6c868d06d0bbe5 (patch)
tree80e7e0036095ec049c1824b58bf7f75ec1eec969
parentda24f734e532a5725b759ceee5b331255cb5f424 (diff)
fix(store-init): re-sync after running auto store init (#1834)
-rw-r--r--atuin/src/command/client/sync.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/atuin/src/command/client/sync.rs b/atuin/src/command/client/sync.rs
index 1fb64a6e..4889cbca 100644
--- a/atuin/src/command/client/sync.rs
+++ b/atuin/src/command/client/sync.rs
@@ -105,7 +105,17 @@ async fn run(
println!("Running automatic history store init...");
// Internally we use the global filter mode, so this context is ignored.
+ // don't recurse or loop here.
history_store.init_store(db).await?;
+
+ println!("Re-running sync due to new records locally");
+
+ // we'll want to run sync once more, as there will now be stuff to upload
+ 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?;