Skip to content

Commit

Permalink
fix(sync): check store length after sync, not before (#1805)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellie committed Mar 1, 2024
1 parent aec5df4 commit 291791e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions atuin/src/command/client/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;

Expand All @@ -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?;
}
Expand Down

0 comments on commit 291791e

Please sign in to comment.