fix(zip): stream ZIP to temp file instead of loading entire archive into RAM
Solution C - Hybrid temp-file streaming: - ZipPort trait now returns NamedTempFile instead of Vec<u8> - ZipService writes to a temp file via ZipWriter<std::fs::File> (O(1) RAM) - Files are read in 64KB stream chunks via get_file_stream() instead of get_file_content() - HTTP response streams the temp file via ReaderStream (never loads full ZIP in memory) - Temp file auto-deleted on drop after response completes - Removed dead imports (HeaderName, HeaderValue, Cursor, Read)
This commit is contained in:
+1
-1
@@ -50,7 +50,7 @@ impl ZipPort for StubZipPort {
|
||||
&self,
|
||||
_folder_id: &str,
|
||||
_folder_name: &str,
|
||||
) -> Result<Vec<u8>, DomainError> {
|
||||
) -> Result<tempfile::NamedTempFile, DomainError> {
|
||||
Err(DomainError::internal_error(
|
||||
"ZipService",
|
||||
"ZipService not initialized",
|
||||
|
||||
Reference in New Issue
Block a user