updater: don't throw errors when running in a daemon

Fixes #1344

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-11-18 17:00:48 +02:00
parent 7b4be8d8ce
commit 89b601b319
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ class Daemon(object): # pragma: no cover
cmd = [sys.executable]
if not is_binary():
cmd += ['-m', 'dvc']
cmd += ['daemon', name, '-v']
cmd += ['daemon', name, '-q']
Logger.debug("Trying to spawn '{}'".format(cmd))
+8 -2
View File
@@ -72,8 +72,14 @@ class Updater(object): # pragma: no cover
def _get_latest_version(self):
import json
r = requests.get(self.URL, timeout=self.TIMEOUT_GET)
info = r.json()
try:
r = requests.get(self.URL, timeout=self.TIMEOUT_GET)
info = r.json()
except requests.exceptions.RequestException as exc:
msg = "Failed to retrieve latest version: {}"
Logger.debug(msg.format(exc))
return
with open(self.updater_file, 'w+') as fobj:
json.dump(info, fobj)