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

Method save_chunk

core/storage.py:945–948  ·  view source on GitHub ↗

保存分片到 OpenDAL 存储

(self, upload_id: str, chunk_index: int, chunk_data: bytes, chunk_hash: str, save_path: str)

Source from the content-addressed store, hash-verified

943 raise HTTPException(status_code=404, detail="文件已过期删除")
944
945 async def save_chunk(self, upload_id: str, chunk_index: int, chunk_data: bytes, chunk_hash: str, save_path: str):
946 """保存分片到 OpenDAL 存储"""
947 chunk_path = str(Path(save_path).parent / "chunks" / upload_id / f"{chunk_index}.part")
948 await self.operator.write(chunk_path, chunk_data)
949
950 async def merge_chunks(self, upload_id: str, chunk_info: UploadChunk, save_path: str) -> tuple[str, str]:
951 """合并 OpenDAL 存储上的分片文件,使用临时文件避免内存问题"""

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected