attic: always prefer streams

This commit is contained in:
cy 2025-03-20 16:10:39 -04:00
parent 959deb8dbc
commit 8ffe43a441
Signed by: cy
SSH key fingerprint: SHA256:o/geVWV4om1QhUSkKvDQeW/eAihwnjyXkqMwrVdbuts

View file

@ -1,7 +1,16 @@
diff --git a/server/src/api/binary_cache.rs b/server/src/api/binary_cache.rs
index 02e4857..71eeee8 100644
index 02e4857..b522154 100644
--- a/server/src/api/binary_cache.rs
+++ b/server/src/api/binary_cache.rs
@@ -215,7 +215,7 @@ async fn get_nar(
let chunk = chunks[0].as_ref().unwrap();
let remote_file = &chunk.remote_file.0;
let storage = state.storage().await?;
- match storage.download_file_db(remote_file, false).await? {
+ match storage.download_file_db(remote_file, true).await? {
Download::Url(url) => Ok(Redirect::temporary(&url).into_response()),
Download::AsyncRead(stream) => {
let stream = ReaderStream::new(stream).map_err(|e| {
@@ -262,7 +262,7 @@ async fn get_nar(
// TODO: Make num_prefetch configurable
@ -11,3 +20,4 @@ index 02e4857..71eeee8 100644
tracing::error!(%e, "Stream error");
e
});