From d2240e1163a62f96dfb1cb99c38ffa2390d53c33 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Sun, 21 May 2023 16:21:51 +0100 Subject: Allow server configured page size (#994) * Allow server configured page size * Backwards compat via semver checks * Correct header name --- atuin-client/src/sync.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'atuin-client/src') diff --git a/atuin-client/src/sync.rs b/atuin-client/src/sync.rs index e62a1483..abe6ce78 100644 --- a/atuin-client/src/sync.rs +++ b/atuin-client/src/sync.rs @@ -11,7 +11,7 @@ use crate::{ api_client, database::Database, encryption::{encrypt, load_encoded_key, load_key}, - settings::{Settings, HISTORY_PAGE_SIZE}, + settings::Settings, }; pub fn hash_str(string: &str) -> String { @@ -72,7 +72,7 @@ async fn sync_download( local_count = db.history_count().await?; - if page.len() < HISTORY_PAGE_SIZE.try_into().unwrap() { + if page.len() < remote_status.page_size.try_into().unwrap() { break; } @@ -134,7 +134,7 @@ async fn sync_upload( let mut cursor = Utc::now(); while local_count > remote_count { - let last = db.before(cursor, HISTORY_PAGE_SIZE).await?; + let last = db.before(cursor, remote_status.page_size).await?; let mut buffer = Vec::new(); if last.is_empty() { -- cgit v1.3.1