Skip to content

Commit e431e7a

Browse files
committed
skip docker APIError when getinfo
1 parent bac9b74 commit e431e7a

File tree

1 file changed

+9
-5
lines changed
  • images/utils/launcher/node

1 file changed

+9
-5
lines changed

images/utils/launcher/node/xud.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from concurrent.futures import wait
99
from threading import Event
1010
from typing import List, Optional
11+
import docker.errors
1112

1213
from launcher.table import ServiceTable
1314
from launcher.utils import yes_or_no, normalize_path
@@ -478,11 +479,14 @@ def ensure_ready(self, stop: Event):
478479
# xud is starting... try again in a few seconds
479480
# xud is locked, run 'xucli unlock', 'xucli create', or 'xucli restore' then try again
480481
while not stop.is_set():
481-
exit_code, output = self.exec(self._cli + " getinfo -j")
482-
if exit_code == 0:
483-
break
484-
if "xud is locked" in output:
485-
break
482+
try:
483+
exit_code, output = self.exec(self._cli + " getinfo -j")
484+
if exit_code == 0:
485+
break
486+
if "xud is locked" in output:
487+
break
488+
except docker.errors.APIError:
489+
logger.exception("Failed to getinfo")
486490
stop.wait(3)
487491

488492
if not self.has_wallets():

0 commit comments

Comments
 (0)