Skip to content

Commit a65cf32

Browse files
committed
revert: 取消秒传
1 parent 4a50908 commit a65cf32

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

apps/base/views.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,20 @@ async def download_file(key: str, code: str, ip: str = Depends(ip_limit["error"]
162162

163163
@chunk_api.post("/upload/init/", dependencies=[Depends(share_required_login)])
164164
async def init_chunk_upload(data: InitChunkUploadModel):
165-
# 秒传检查
166-
existing = await FileCodes.filter(file_hash=data.file_hash).first()
167-
if existing:
168-
if await existing.is_expired():
169-
file_storage: FileStorageInterface = storages[settings.file_storage](
170-
)
171-
await file_storage.delete_file(existing)
172-
await existing.delete()
173-
else:
174-
return APIResponse(detail={
175-
"code": existing.code,
176-
"existed": True,
177-
"name": f'{existing.prefix}{existing.suffix}'
178-
})
165+
# # 秒传检查
166+
# existing = await FileCodes.filter(file_hash=data.file_hash).first()
167+
# if existing:
168+
# if await existing.is_expired():
169+
# file_storage: FileStorageInterface = storages[settings.file_storage](
170+
# )
171+
# await file_storage.delete_file(existing)
172+
# await existing.delete()
173+
# else:
174+
# return APIResponse(detail={
175+
# "code": existing.code,
176+
# "existed": True,
177+
# "name": f'{existing.prefix}{existing.suffix}'
178+
# })
179179

180180
# 创建上传会话
181181
upload_id = uuid.uuid4().hex

0 commit comments

Comments
 (0)