Skip to content

Commit 344246c

Browse files
committed
http => https comms method string, play via zmq
1 parent 3b52874 commit 344246c

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

cylc/uiserver/client.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,14 @@ async def async_request(
6666
if not args:
6767
args = {}
6868

69-
with open(API_INFO_FILE, "r") as api_file:
70-
api_info = json.loads(api_file.read())
69+
try:
70+
with open(API_INFO_FILE, "r") as api_file:
71+
api_info = json.loads(api_file.read())
72+
except FileNotFoundError:
73+
raise ClientError(
74+
'API info not found, is the UI-Server running?\n'
75+
f'({API_INFO_FILE})'
76+
)
7177

7278
# send message
7379
msg: Dict[str, Any] = {'command': command, 'args': args}
@@ -96,6 +102,11 @@ async def async_request(
96102
request_timeout=float(self.timeout)
97103
)
98104
res = await AsyncHTTPClient().fetch(request)
105+
except ConnectionRefusedError:
106+
raise ClientError(
107+
'Connection refused, is the UI-Server running?\n'
108+
f'({api_info["url"]}cylc/graphql)'
109+
)
99110
except HTTPClientError as exc:
100111
raise ClientError(
101112
'Client error with Hub/UI-Server request.',
@@ -147,7 +158,7 @@ def get_header(self) -> dict:
147158
'comms_method':
148159
os.getenv(
149160
"CLIENT_COMMS_METH",
150-
default=CommsMeth.HTTP.value
161+
default=CommsMeth.HTTPS.value
151162
)
152163
}
153164
}

cylc/uiserver/resolvers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ async def play(cls, workflows, args, workflows_mgr, log):
271271
args.pop('cylc_version')
272272

273273
# build the command
274-
cmd = ['cylc', 'play', '--color=never']
274+
cmd = ['cylc', 'play', '--color=never', '--comms-method=zmq']
275275
cmd = _build_cmd(cmd, args)
276276

277277
except Exception as exc:

0 commit comments

Comments
 (0)