1
1
mirror of https://github.com/ellie/atuin.git synced 2024-10-27 07:40:53 +03:00

fix(sync): record size limiter (#1827)

Settings the record size limit to 0 had issues. Inverting the condition
works better.
This commit is contained in:
Ellie Huxtable 2024-03-05 09:42:10 +00:00 committed by GitHub
parent b1155873dd
commit 799dd1b0a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,11 +27,11 @@ pub async fn post<DB: Database>(
counter!("atuin_record_uploaded", records.len() as u64); counter!("atuin_record_uploaded", records.len() as u64);
let too_big = records let keep = records
.iter() .iter()
.any(|r| r.data.data.len() >= settings.max_record_size || settings.max_record_size == 0); .all(|r| r.data.data.len() <= settings.max_record_size || settings.max_record_size == 0);
if too_big { if !keep {
counter!("atuin_record_too_large", 1); counter!("atuin_record_too_large", 1);
return Err( return Err(