mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-27 10:14:40 +10:00
fix: limit chunks to 512 files each
This commit is contained in:
Generated
+1
-1
@@ -219,7 +219,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "droplet-rs"
|
name = "droplet-rs"
|
||||||
version = "0.14.0"
|
version = "0.14.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Drop-OSS"]
|
authors = ["Drop-OSS"]
|
||||||
name = "droplet-rs"
|
name = "droplet-rs"
|
||||||
version = "0.14.0"
|
version = "0.14.1"
|
||||||
license = "AGPL-3.0-only"
|
license = "AGPL-3.0-only"
|
||||||
description = "Droplet is a `napi.rs` Rust/Node.js package full of high-performance and low-level utils for Drop"
|
description = "Droplet is a `napi.rs` Rust/Node.js package full of high-performance and low-level utils for Drop"
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ pub struct Manifest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CHUNK_SIZE: u64 = 1024 * 1024 * 64;
|
const CHUNK_SIZE: u64 = 1024 * 1024 * 64;
|
||||||
const WIGGLE: u64 = 1024 * 1024;
|
const MAX_FILE_COUNT: usize = 512;
|
||||||
|
|
||||||
use crate::versions::{create_backend_constructor, types::VersionFile};
|
use crate::versions::{create_backend_constructor, types::VersionFile};
|
||||||
|
|
||||||
@@ -85,10 +85,18 @@ pub async fn generate_manifest_rusty<T: Fn(String), V: Fn(f32)>(
|
|||||||
chunks.push(new_chunk);
|
chunks.push(new_chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if current_chunk.len() >= MAX_FILE_COUNT {
|
||||||
|
chunks.push(std::mem::take(&mut current_chunk));
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for version_file in files {
|
for version_file in files {
|
||||||
|
if current_chunk.len() >= MAX_FILE_COUNT {
|
||||||
|
chunks.push(std::mem::take(&mut current_chunk));
|
||||||
|
}
|
||||||
|
|
||||||
let current_size = current_chunk.iter().map(|v| v.2).sum::<u64>();
|
let current_size = current_chunk.iter().map(|v| v.2).sum::<u64>();
|
||||||
|
|
||||||
if version_file.size + current_size < CHUNK_SIZE {
|
if version_file.size + current_size < CHUNK_SIZE {
|
||||||
|
|||||||
Reference in New Issue
Block a user