fix: memory issues when importing giant mrpack files (#6278)

* feat: dont load mrpacks into memory if they are local imports

* fix: frontend
This commit is contained in:
Calum H.
2026-06-02 12:59:41 +00:00
committed by GitHub
parent 6b0a0c1897
commit cfe45b368c
11 changed files with 333 additions and 92 deletions
+21 -1
View File
@@ -1932,10 +1932,30 @@ pub async fn cache_file_hash(
sha1_async(bytes).await?
};
cache_file_hash_metadata(
profile_path,
path,
size as u64,
hash,
project_type,
exec,
)
.await
}
pub async fn cache_file_hash_metadata(
profile_path: &str,
path: &str,
size: u64,
hash: String,
project_type: Option<ProjectType>,
exec: impl sqlx::Executor<'_, Database = sqlx::Sqlite>,
) -> crate::Result<()> {
// Streamed extraction already computed these values, so avoid buffering the file just to cache them.
CachedEntry::upsert_many(
&[CacheValue::FileHash(CachedFileHash {
path: format!("{profile_path}/{path}"),
size: size as u64,
size,
hash,
project_type,
})