fix:文件不存在删除报错

This commit is contained in:
lan
2022-12-22 20:15:04 +08:00
parent 0d5e26f752
commit 64f476e6db
+1
View File
@@ -49,6 +49,7 @@ class FileSystemStorage:
async def delete_file(self, text: str): async def delete_file(self, text: str):
filepath = await self.get_filepath(text) filepath = await self.get_filepath(text)
if filepath.exists():
await asyncio.to_thread(os.remove, filepath) await asyncio.to_thread(os.remove, filepath)
async def delete_files(self, texts): async def delete_files(self, texts):