避免漏传chunk
This commit is contained in:
parent
9ad58b8940
commit
4be2962faa
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user