mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
When uploading installers, try repeatedly in case of failure
This commit is contained in:
parent
fe0744431f
commit
f2ce27fae9
@ -141,8 +141,17 @@ class UploadToGoogleCode(Command): # {{{
|
|||||||
'dmg':'OSX','bz2':'Linux','gz':'All'}[ext]
|
'dmg':'OSX','bz2':'Linux','gz':'All'}[ext]
|
||||||
desc = installer_description(fname)
|
desc = installer_description(fname)
|
||||||
start = time.time()
|
start = time.time()
|
||||||
path = self.upload(os.path.abspath(fname), desc,
|
for i in range(5):
|
||||||
labels=[typ, op, 'Featured'])
|
try:
|
||||||
|
path = self.upload(os.path.abspath(fname), desc,
|
||||||
|
labels=[typ, op, 'Featured'])
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
traceback.print_exc()
|
||||||
|
print ('\nUpload failed, trying again in 30 secs')
|
||||||
|
time.sleep(30)
|
||||||
|
else:
|
||||||
|
break
|
||||||
self.info('Uploaded to:', path, 'in', int(time.time() - start),
|
self.info('Uploaded to:', path, 'in', int(time.time() - start),
|
||||||
'seconds')
|
'seconds')
|
||||||
return path
|
return path
|
||||||
@ -312,9 +321,16 @@ class UploadToSourceForge(Command): # {{{
|
|||||||
if not os.path.exists(x): continue
|
if not os.path.exists(x): continue
|
||||||
start = time.time()
|
start = time.time()
|
||||||
self.info('Uploading', x)
|
self.info('Uploading', x)
|
||||||
check_call(['rsync', '-z', '--progress', '-e', 'ssh -x', x,
|
for i in range(5):
|
||||||
'%s,%s@frs.sourceforge.net:%s'%(self.USERNAME, self.PROJECT,
|
try:
|
||||||
self.rdir+'/')])
|
check_call(['rsync', '-z', '--progress', '-e', 'ssh -x', x,
|
||||||
|
'%s,%s@frs.sourceforge.net:%s'%(self.USERNAME, self.PROJECT,
|
||||||
|
self.rdir+'/')])
|
||||||
|
except:
|
||||||
|
print ('\nUpload failed, trying again in 30 seconds')
|
||||||
|
time.sleep(30)
|
||||||
|
else:
|
||||||
|
break
|
||||||
print 'Uploaded in', int(time.time() - start), 'seconds'
|
print 'Uploaded in', int(time.time() - start), 'seconds'
|
||||||
print ('\n')
|
print ('\n')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user