From 156893d774b4da5b541fdbb08428f9ec392949a0 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Sun, 25 Apr 2021 18:21:52 +0100 Subject: Update docs, unify on SQLx, bugfixes (#40) * Begin moving to sqlx for local too * Stupid scanners should just have a nice cup of tea Random internet shit searching for /.env or whatever * Remove diesel and rusqlite fully --- atuin-client/src/sync.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'atuin-client/src/sync.rs') diff --git a/atuin-client/src/sync.rs b/atuin-client/src/sync.rs index 5d81a5e6..94408018 100644 --- a/atuin-client/src/sync.rs +++ b/atuin-client/src/sync.rs @@ -30,7 +30,7 @@ async fn sync_download( let remote_count = client.count().await?; - let initial_local = db.history_count()?; + let initial_local = db.history_count().await?; let mut local_count = initial_local; let mut last_sync = if force { @@ -48,9 +48,9 @@ async fn sync_download( .get_history(last_sync, last_timestamp, host.clone()) .await?; - db.save_bulk(&page)?; + db.save_bulk(&page).await?; - local_count = db.history_count()?; + local_count = db.history_count().await?; if page.len() < HISTORY_PAGE_SIZE.try_into().unwrap() { break; @@ -87,7 +87,7 @@ async fn sync_upload( let initial_remote_count = client.count().await?; let mut remote_count = initial_remote_count; - let local_count = db.history_count()?; + let local_count = db.history_count().await?; debug!("remote has {}, we have {}", remote_count, local_count); @@ -98,7 +98,7 @@ async fn sync_upload( let mut cursor = Utc::now(); while local_count > remote_count { - let last = db.before(cursor, HISTORY_PAGE_SIZE)?; + let last = db.before(cursor, HISTORY_PAGE_SIZE).await?; let mut buffer = Vec::::new(); if last.is_empty() { -- cgit v1.3.1