Dont fail to run if the update check fails

This commit is contained in:
Kovid Goyal 2019-02-02 15:36:32 +05:30
parent 670de085a3
commit ddb961f9af
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -97,14 +97,20 @@ def process_current_release(raw):
def update_check(timer_id=None): def update_check(timer_id=None):
try:
p = subprocess.Popen([ p = subprocess.Popen([
kitty_exe(), '+runpy', kitty_exe(), '+runpy',
'from kitty.update_check import *; import time, random; time.sleep(random.randint(1000, 4000) / 1000); print(get_released_version())' 'from kitty.update_check import *; import time, random; time.sleep(random.randint(1000, 4000) / 1000); print(get_released_version())'
], stdout=subprocess.PIPE) ], stdout=subprocess.PIPE)
except EnvironmentError:
import traceback
traceback.print_exc()
return False
monitor_pid(p.pid) monitor_pid(p.pid)
get_boss().set_update_check_process(p) get_boss().set_update_check_process(p)
return True
def run_update_check(interval=24 * 60 * 60): def run_update_check(interval=24 * 60 * 60):
update_check() if update_check():
add_timer('update_check', update_check, interval) add_timer('update_check', update_check, interval)