保存分片到 OpenDAL 存储
(self, upload_id: str, chunk_index: int, chunk_data: bytes, chunk_hash: str, save_path: str)
| 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 存储上的分片文件,使用临时文件避免内存问题""" |