fix:文件不存在删除报错
This commit is contained in:
1 parent
0d5e26f752
commit
64f476e6db
1 file changed
+1
@@ -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):
|
||||||
|
|||||||
Reference in new issue
Block a user