(file_path, chunk_size=2 * 1024 * 1024)
| 211 | # Streaming fallback for non-nginx deployments |
| 212 | logger.info(f"[DOWNLOAD] Using streaming fallback (no nginx)") |
| 213 | def file_iterator(file_path, chunk_size=2 * 1024 * 1024): |
| 214 | with open(file_path, "rb") as f: |
| 215 | while chunk := f.read(chunk_size): |
| 216 | yield chunk |
| 217 | |
| 218 | response = StreamingHttpResponse( |
| 219 | file_iterator(backup_file), |
no test coverage detected