mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
check wakatime-cli versions in background thread to prevent blocking UI
This commit is contained in:
parent
28063e3ac4
commit
c1f58fd05d
@ -594,9 +594,7 @@ def plugin_loaded():
|
|||||||
log(INFO, 'Initializing WakaTime plugin v%s' % __version__)
|
log(INFO, 'Initializing WakaTime plugin v%s' % __version__)
|
||||||
update_status_bar('Initializing...')
|
update_status_bar('Initializing...')
|
||||||
|
|
||||||
if not isCliLatest():
|
UpdateCLI().start()
|
||||||
thread = DownloadCLI()
|
|
||||||
thread.start()
|
|
||||||
|
|
||||||
after_loaded()
|
after_loaded()
|
||||||
|
|
||||||
@ -632,11 +630,14 @@ class WakatimeDashboardCommand(sublime_plugin.ApplicationCommand):
|
|||||||
webbrowser.open_new_tab('https://wakatime.com/dashboard')
|
webbrowser.open_new_tab('https://wakatime.com/dashboard')
|
||||||
|
|
||||||
|
|
||||||
class DownloadCLI(threading.Thread):
|
class UpdateCLI(threading.Thread):
|
||||||
"""Non-blocking thread for downloading latest wakatime-cli from GitHub.
|
"""Non-blocking thread for downloading latest wakatime-cli from GitHub.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
if isCliLatest():
|
||||||
|
return
|
||||||
|
|
||||||
log(INFO, 'Downloading wakatime-cli...')
|
log(INFO, 'Downloading wakatime-cli...')
|
||||||
|
|
||||||
if os.path.isdir(os.path.join(RESOURCES_FOLDER, 'wakatime-cli')):
|
if os.path.isdir(os.path.join(RESOURCES_FOLDER, 'wakatime-cli')):
|
||||||
|
Loading…
Reference in New Issue
Block a user