mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Robustness improvements
This commit is contained in:
parent
424b9e1884
commit
dd7f18eb54
@ -508,12 +508,14 @@ def upload_to_servers(files, version): # {{{
|
|||||||
|
|
||||||
def upload_to_dbs(files, version): # {{{
|
def upload_to_dbs(files, version): # {{{
|
||||||
print('Uploading to fosshub.com')
|
print('Uploading to fosshub.com')
|
||||||
|
sys.stdout.flush()
|
||||||
server = 'mirror1.fosshub.com'
|
server = 'mirror1.fosshub.com'
|
||||||
rdir = 'release/'
|
rdir = 'release/'
|
||||||
check_call(['ssh', 'kovid@%s' % server, 'rm -f release/*'])
|
check_call(['ssh', 'kovid@%s' % server, 'rm -f release/*'])
|
||||||
for x in files:
|
for x in files:
|
||||||
start = time.time()
|
start = time.time()
|
||||||
print ('Uploading', x)
|
print ('Uploading', x)
|
||||||
|
sys.stdout.flush()
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
try:
|
try:
|
||||||
check_call(['rsync', '-h', '-z', '--progress', '-e', 'ssh -x', x,
|
check_call(['rsync', '-h', '-z', '--progress', '-e', 'ssh -x', x,
|
||||||
@ -522,10 +524,12 @@ def upload_to_dbs(files, version): # {{{
|
|||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
except:
|
except:
|
||||||
print ('\nUpload failed, trying again in 30 seconds')
|
print ('\nUpload failed, trying again in 30 seconds')
|
||||||
|
sys.stdout.flush()
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
print ('Uploaded in', int(time.time() - start), 'seconds\n\n')
|
print ('Uploaded in', int(time.time() - start), 'seconds\n\n')
|
||||||
|
sys.stdout.flush()
|
||||||
check_call(['ssh', 'kovid@%s' % server, '/home/kovid/uploadFiles'])
|
check_call(['ssh', 'kovid@%s' % server, '/home/kovid/uploadFiles'])
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
@ -70,6 +70,10 @@ class ReUpload(Command): # {{{
|
|||||||
|
|
||||||
def pre_sub_commands(self, opts):
|
def pre_sub_commands(self, opts):
|
||||||
opts.replace = True
|
opts.replace = True
|
||||||
|
exists = {x for x in installers() if os.path.exists(x)}
|
||||||
|
if not exists:
|
||||||
|
print ('There appear to be no installers!')
|
||||||
|
raise SystemExit(1)
|
||||||
|
|
||||||
def run(self, opts):
|
def run(self, opts):
|
||||||
upload_signatures()
|
upload_signatures()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user