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:
parent
b1155873dd
commit
799dd1b0a9
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user