Skip to content

Commit 69f4339

Browse files
committed
Adds a TODO item to optimize zip file creation.
Adds a TODO item to address potential memory issues when creating zip files, especially when dealing with large documents or numerous files.
1 parent 1482004 commit 69f4339

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/apps/integrations/oneup_health/service/oneup_health.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,10 @@ async def _download_and_store_documents(
521521
base_path = f"{data.activity_id}/{data.submit_id}"
522522
zip_filename = EHRStorage.docs_zip_filename(data)
523523

524+
# TODO: Optimize this function to avoid loading all files in memory when creating the zip file.
525+
# Current implementation loads all document content into memory before writing to the zip file,
526+
# which can cause memory issues with large documents or many documents.
527+
# Consider using a streaming approach or temporary files to reduce memory usage.
524528
zip_buffer = io.BytesIO()
525529
try:
526530
with zipfile.ZipFile(zip_buffer, "w", compression=zipfile.ZIP_DEFLATED) as zip_file:

0 commit comments

Comments
 (0)