🐛 fix(webdav): 保证流式上传取消后清理未发布文件
This commit is contained in:
1 parent
8a3147ef0d
commit
dd905c5c90
3 files changed
+9
-9
No files matched your search
@@ -92,11 +92,4 @@ class WebDAVStreamMixin:
|
||||
return save_path,digest
|
||||
|
||||
async def clean_stream_upload(self, upload_id, save_path):
|
||||
info = await self._stream_session(upload_id)
|
||||
if info is None:
|
||||
return
|
||||
directory = str(PurePosixPath(self._stream_part_path(info, 0)).parent)
|
||||
async with aiohttp.ClientSession(auth=self.auth, timeout=OFFSET_TIMEOUT) as client:
|
||||
async with client.delete(self._build_url(directory)) as response:
|
||||
if response.status not in (200, 204, 404):
|
||||
raise HTTPException(503, 'WebDAV 分片清理失败,请重试')
|
||||
await self.clean_offset_upload(upload_id, save_path)
|
||||
Reference in new issue
Block a user