Skip to content

Commit

Permalink
[resotoshell][fix] Wait for resotocore to be online when starting (#1091
Browse files Browse the repository at this point in the history
)
  • Loading branch information
meln1k committed Aug 18, 2022
1 parent 8b1c506 commit 726bb78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions resotoshell/resotoshell/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import resotolib.proc
from resotoclient import ResotoClient
from resotolib.args import ArgumentParser
from resotolib.core import resotocore, add_args as core_add_args, resotocore_is_up
from resotolib.core import resotocore, add_args as core_add_args, wait_for_resotocore
from resotolib.core.ca import TLSData
from resotolib.event import add_event_listener, Event as ResotoEvent, EventType
from resotolib.jwt import add_args as jwt_add_args
Expand All @@ -30,7 +30,9 @@ def main() -> None:
TLSData.add_args(arg_parser, ca_only=True)
args: Namespace = arg_parser.parse_args()

if not resotocore_is_up(resotocore.http_uri):
try:
wait_for_resotocore(resotocore.http_uri, timeout=5)
except TimeoutError:
log.fatal(f"resotocore is not online at {resotocore.http_uri}")
sys.exit(1)

Expand Down

0 comments on commit 726bb78

Please sign in to comment.