use server side offset if provided
This commit is contained in:
parent
fc0d0612c8
commit
72b5643e68
1 changed files with 4 additions and 0 deletions
|
@ -1048,6 +1048,10 @@ class API(ox.API):
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
if data and data.get('result') == 1:
|
if data and data.get('result') == 1:
|
||||||
done += len(chunk)
|
done += len(chunk)
|
||||||
|
if data.get('offset') not in (None, done):
|
||||||
|
print 'server offset out of sync, continue from', data['offset']
|
||||||
|
done = data['offset']
|
||||||
|
f.seek(done)
|
||||||
with open(self._resume_file, 'w') as r:
|
with open(self._resume_file, 'w') as r:
|
||||||
json.dump({
|
json.dump({
|
||||||
'uploadUrl': uploadUrl,
|
'uploadUrl': uploadUrl,
|
||||||
|
|
Loading…
Reference in a new issue