MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / file_iterator

Function file_iterator

apps/backups/api_views.py:213–216  ·  view source on GitHub ↗
(file_path, chunk_size=2 * 1024 * 1024)

Source from the content-addressed store, hash-verified

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),

Callers 2

fileMethod · 0.85
download_backupFunction · 0.85

Calls 1

readMethod · 0.80

Tested by

no test coverage detected