MCPcopy Create free account
hub / github.com/vastsa/FileCodeBox / file_sender

Method file_sender

core/storage.py:1094–1101  ·  view source on GitHub ↗

流式读取文件内容

()

Source from the content-addressed store, hash-verified

1092 url = self._build_url(safe_save_path)
1093
1094 async def file_sender():
1095 """流式读取文件内容"""
1096 chunk_size = 256 * 1024 # 256KB chunks
1097 while True:
1098 chunk = await asyncio.to_thread(file.file.read, chunk_size)
1099 if not chunk:
1100 break
1101 yield chunk
1102
1103 async with aiohttp.ClientSession(auth=self.auth) as session:
1104 async with session.put(

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected