Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d0a790ef5 | ||
|
|
e2a8a9b49f | ||
|
|
290be28dae | ||
|
|
f488e985ab | ||
|
|
8678e25427 | ||
|
|
d41c1c4c00 |
No files matched your search
@@ -55,7 +55,7 @@ class ShellCommand:
|
||||
except Exception:
|
||||
logging.exception(
|
||||
f"shell_command: Command ({self.name}) failed")
|
||||
return
|
||||
return False
|
||||
if verbose:
|
||||
fd = proc.stdout.fileno()
|
||||
self.io_loop.add_handler(
|
||||
|
||||
@@ -123,11 +123,16 @@ class UpdateManager:
|
||||
'version_info': vinfo,
|
||||
'busy': self.current_update is not None}
|
||||
|
||||
async def execute_cmd(self, cmd, timeout=10., notify=False):
|
||||
async def execute_cmd(self, cmd, timeout=10., notify=False, retries=1):
|
||||
shell_command = self.server.lookup_plugin('shell_command')
|
||||
cb = self.notify_update_response if notify else None
|
||||
scmd = shell_command.build_shell_command(cmd, callback=cb)
|
||||
await scmd.run(timeout=timeout, verbose=notify)
|
||||
while retries:
|
||||
if await scmd.run(timeout=timeout, verbose=notify):
|
||||
break
|
||||
retries -= 1
|
||||
if not retries:
|
||||
raise self.server.error("Shell Command Error")
|
||||
|
||||
async def execute_cmd_with_response(self, cmd, timeout=10.):
|
||||
shell_command = self.server.lookup_plugin('shell_command')
|
||||
@@ -350,7 +355,7 @@ class GitUpdater:
|
||||
shutil.rmtree(env_path)
|
||||
try:
|
||||
await self.execute_cmd(
|
||||
f"virtualenv {env_args} {env_path}")
|
||||
f"virtualenv {env_args} {env_path}", timeout=300.)
|
||||
except Exception:
|
||||
self._log_exc(f"Error creating virtualenv")
|
||||
return
|
||||
@@ -365,7 +370,8 @@ class GitUpdater:
|
||||
self._notify_status("Updating python packages...")
|
||||
try:
|
||||
await self.execute_cmd(
|
||||
f"{pip} install -r {reqs}", timeout=1200., notify=True)
|
||||
f"{pip} install -r {reqs}", timeout=1200., notify=True,
|
||||
retries=3)
|
||||
except Exception:
|
||||
self._log_exc("Error updating python requirements")
|
||||
|
||||
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
env_version=0.2.0
|
||||
deps_version=0.2.0
|
||||
env_version=0.2.2
|
||||
deps_version=0.2.2
|
||||
Reference in new issue
Block a user