dont reuse url for url param and result url

This commit is contained in:
j 2013-02-15 16:11:37 +05:30
parent 421feeb878
commit 9e66bb6c62

View file

@ -690,7 +690,7 @@ class API(ox.API):
if os.path.exists(self._resume_file): if os.path.exists(self._resume_file):
with open(self._resume_file) as f: with open(self._resume_file) as f:
resume = json.load(f) resume = json.load(f)
if resume.get('url') != url: if resume.get('chunkUploadUrl') != url:
resume = None resume = None
if resume: if resume:
data = resume data = resume
@ -758,7 +758,8 @@ class API(ox.API):
with open(self._resume_file, 'w') as r: with open(self._resume_file, 'w') as r:
json.dump({ json.dump({
'uploadUrl': uploadUrl, 'uploadUrl': uploadUrl,
'url': url, 'chunkUploadUrl': url,
'url': result_url,
'offset': done 'offset': done
}, r, indent=2) }, r, indent=2)
chunk = f.read(CHUNK_SIZE) chunk = f.read(CHUNK_SIZE)