Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reliveyy committed Oct 21, 2020
1 parent d719bd5 commit 76ab108
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions images/utils/launcher/node/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from docker import DockerClient
from docker.errors import ImageNotFound

from launcher.errors import FatalError
from launcher.errors import FatalError, NoWaiting
from launcher.utils import yes_or_no

if TYPE_CHECKING:
from .base import Node
Expand Down Expand Up @@ -352,11 +353,17 @@ def check_for_updates(self) -> Dict[Image, str]:
executor = self.config.executor

futs = {executor.submit(img.get_update_action): img for img in images}
done, not_done = wait(futs, 30)
for f in not_done:
logger.debug("Failed future %s", f)
if len(not_done) > 0:
raise RuntimeError("Failed to check for image updates")

while True:
done, not_done = wait(futs, 30)
if len(not_done) > 0:
names = ", ".join([futs[f].name for f in not_done])
print("Still waiting for update checking results of image(s): %s" % names)
reply = yes_or_no("Would you like to keep waiting?")
if reply == "no":
raise NoWaiting
else:
break

result = {}
for f in done:
Expand Down
2 changes: 1 addition & 1 deletion images/utils/launcher/node/xud.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def _ensure_dependencies_ready(self, stop: threading.Event):
names_str = ", ".join(names)
reply = yes_or_no("Keep waiting for {} to be ready?".format(names_str))
if reply == "no":
raise Exception("Give up waiting for {}".format(names_str))
raise NoWaiting

def _save_seed(self, output):
s = output
Expand Down

0 comments on commit 76ab108

Please sign in to comment.