Skip to content

Commit 8602e40

Browse files
committed
Send websocket message to trigger refresh on frontend after database cleanup
1 parent 7b587ea commit 8602e40

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/murfey/client/multigrid_control.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def clean_up_once_dormant(self, running_threads: list[threading.Thread]):
158158
while not self.is_ready_for_dormancy():
159159
time.sleep(10)
160160

161-
# Once all threads are stopped, remove it from the database
161+
# Once all threads are stopped, remove session from the database
162162
log.debug(
163163
f"Submitting request to remove session {self.session_id} from database"
164164
)
@@ -168,6 +168,11 @@ def clean_up_once_dormant(self, running_threads: list[threading.Thread]):
168168
success = response.status_code == 200 if response else False
169169
if not success:
170170
log.warning(f"Could not delete database data for {self.session_id}")
171+
172+
# Send message to frontend to trigger a refresh
173+
self.ws.send(json.dumps({"message": "refresh"}))
174+
175+
# Mark as dormant
171176
self.dormant = True
172177

173178
def abandon(self):

0 commit comments

Comments
 (0)