避免漏传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.content)
|
||||
|
||||
if r.status_code == 200 and r.json()['OK'] == 1:
|
||||
r.raise_for_status()
|
||||
if r.status_code == 200 and r.json().get("OK", 0) == 1:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
@ -11,7 +11,7 @@ class Retry:
|
||||
try:
|
||||
return_value = func(*args, **kwargs)
|
||||
except Exception:
|
||||
return_value = not self.success_return_value
|
||||
continue
|
||||
if return_value == self.success_return_value:
|
||||
status = True
|
||||
break
|
||||
|
Loading…
x
Reference in New Issue
Block a user