Skip to content

Commit 13a8c20

Browse files
committed
feat: skip small files (<5KB)
1 parent 07b8fc3 commit 13a8c20

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

magic-nix-cache/src/gha.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ async fn upload_path(
157157
// Upload the NAR.
158158
let nar_path = format!("{}.nar.zstd", path_info.nar_hash.to_base32());
159159

160+
if path_info.nar_size < 5000 {
161+
tracing::debug!(
162+
"Skipping small file '{}' ({}b)",
163+
nar_path,
164+
path_info.nar_size
165+
);
166+
return Ok(());
167+
}
168+
160169
let nar_allocation = api.allocate_file_with_random_suffix(&nar_path).await?;
161170

162171
let nar_stream = store.nar_from_path(path.clone());

0 commit comments

Comments
 (0)