mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-13 15:28:27 +01:00
updater: don't throw errors when running in a daemon
Fixes #1344 Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+1
-1
@@ -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
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user