Skip to content

Commit af43e20

Browse files
committed
Return False early during multigrid controller check if access token for the current session is not found
1 parent 7e95102 commit af43e20

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/murfey/server/api/instrument.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ async def check_multigrid_controller_status(session_id: MurfeySessionID, db=murf
112112
log.debug(
113113
f"Submitting request to inspect multigrid controller for session {session_id}"
114114
)
115+
# Treat it as absent if the server-side has no stored token for the session
116+
if (
117+
instrument_server_tokens.get(session_id, {}).get("access_token", None)
118+
is None
119+
):
120+
return {"exists": False}
115121
async with aiohttp.ClientSession() as clientsession:
116122
async with clientsession.get(
117123
f"{machine_config.instrument_server_url}{url_path_for('api.router', 'check_multigrid_controller_status', session_id=session_id)}",

0 commit comments

Comments
 (0)