aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/sync.rs
diff options
context:
space:
mode:
authorEllie Huxtable <e@elm.sh>2021-04-25 18:21:52 +0100
committerGitHub <noreply@github.com>2021-04-25 17:21:52 +0000
commit156893d774b4da5b541fdbb08428f9ec392949a0 (patch)
tree9185d94384aa62eb6eb099ddc4ca9408df6f90d1 /atuin-client/src/sync.rs
parentAdd to Cargo.toml (diff)
downloadatuin-156893d774b4da5b541fdbb08428f9ec392949a0.zip
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
Diffstat (limited to 'atuin-client/src/sync.rs')
-rw-r--r--atuin-client/src/sync.rs10
1 files changed, 5 insertions, 5 deletions
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::<AddHistoryRequest>::new();
if last.is_empty() {