避免漏传chunk

This commit is contained in:
Jerry Yan 2022-10-01 14:53:11 +08:00
parent 9ad58b8940
commit 4be2962faa
2 changed files with 3 additions and 3 deletions

View File

@ -241,8 +241,8 @@ def upload_chunk(upload_url, server_file_name, local_file_name, chunk_data, chun
) )
print(r.status_code) print(r.status_code)
print(r.content) print(r.content)
r.raise_for_status()
if r.status_code == 200 and r.json()['OK'] == 1: if r.status_code == 200 and r.json().get("OK", 0) == 1:
return True return True
else: else:
return False return False

View File

@ -11,7 +11,7 @@ class Retry:
try: try:
return_value = func(*args, **kwargs) return_value = func(*args, **kwargs)
except Exception: except Exception:
return_value = not self.success_return_value continue
if return_value == self.success_return_value: if return_value == self.success_return_value:
status = True status = True
break break