Skip to content

Commit 06b9116

Browse files
krisctlPrabhakar Kumar
authored andcommitted
Fixes a false positive error message in terminal logs about being unable to forward requests to MATLAB
1 parent 566f759 commit 06b9116

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

matlab_proxy/app.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,16 @@ async def matlab_view(req):
469469
mwapikey = req.app["settings"]["mwapikey"]
470470
matlab_base_url = f"{matlab_protocol}://127.0.0.1:{matlab_port}"
471471

472+
# If we are trying to send request to matlab while the matlab_port is still not assigned
473+
# by embedded connector, return service not available and log a message
474+
if not matlab_port:
475+
logger.debug(
476+
"MATLAB hasn't fully started, please retry after embedded connector has started"
477+
)
478+
raise web.HTTPServiceUnavailable(
479+
"MATLAB hasn't fully started yet, please retry after some time."
480+
)
481+
472482
# WebSocket
473483
# According to according to RFC6455 (https://www.rfc-editor.org/rfc/rfc6455.html)
474484
# the values of 'connection' and 'upgrade' keys of request header

0 commit comments

Comments
 (0)