Method
save_file
(self, file: UploadFile, save_path: str)
Source from the content-addressed store, hash-verified
| 876 | ) |
| 877 | |
| 878 | async def save_file(self, file: UploadFile, save_path: str): |
| 879 | # 使用 asyncio.to_thread 避免阻塞事件循环 |
| 880 | content = await asyncio.to_thread(file.file.read) |
| 881 | await self.operator.write(save_path, content) |
| 882 | |
| 883 | async def delete_file(self, file_code: FileCodes): |
| 884 | await self.operator.delete(await file_code.get_file_path()) |
Callers
nothing calls this directly
Tested by
no test coverage detected