MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / stream_generator

Method stream_generator

core/storage.py:689–704  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

687 pass
688
689 async def stream_generator():
690 try:
691 async with session.get(link) as resp:
692 if resp.status != 200:
693 raise HTTPException(
694 status_code=resp.status,
695 detail=f"从OneDrive获取文件失败: {resp.status}"
696 )
697 chunk_size = 65536
698 while True:
699 chunk = await resp.content.read(chunk_size)
700 if not chunk:
701 break
702 yield chunk
703 finally:
704 await session.close()
705
706 encoded_filename = quote(filename, safe='')
707 headers = {

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected