mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-25 09:44:03 +01: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);
|
||||
|
||||
let too_big = records
|
||||
let keep = records
|
||||
.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);
|
||||
|
||||
return Err(
|
||||
|
Loading…
Reference in New Issue
Block a user