Skip to content

Commit ef967db

Browse files
committed
Added more keys to the websocket messages sent by the multigrid controller, which can be used to target which queries to refetch on the frontend side
1 parent d788216 commit ef967db

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/murfey/client/multigrid_control.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,15 @@ def clean_up_once_dormant(self, running_threads: list[threading.Thread]):
171171
log.warning(f"Could not delete database data for {self.session_id}")
172172

173173
# Send message to frontend to trigger a refresh
174-
self.ws.send(json.dumps({"message": "refresh"}))
174+
self.ws.send(
175+
json.dumps(
176+
{
177+
"message": "refresh",
178+
"target": "sessions",
179+
"instrument_name": self.instrument_name,
180+
}
181+
)
182+
)
175183

176184
# Mark as dormant
177185
self.dormant = True
@@ -268,7 +276,15 @@ def _start_rsyncer_multigrid(
268276
transfer=machine_data.get("data_transfer_enabled", True),
269277
restarted=str(source) in self.rsync_restarts,
270278
)
271-
self.ws.send(json.dumps({"message": "refresh"}))
279+
self.ws.send(
280+
json.dumps(
281+
{
282+
"message": "refresh",
283+
"target": "rsyncer",
284+
"session_id": self.session_id,
285+
}
286+
)
287+
)
272288

273289
def _rsyncer_stopped(self, source: Path, explicit_stop: bool = False):
274290
if explicit_stop:

0 commit comments

Comments
 (0)