DAQ/GUI: updated gui session managmmenet so baton holder is shown in GUI and gui sessions are closed and removed from redis
This commit is contained in:
1 parent
947e142f6e
commit
1865fd3dea
3 files changed
+8
-5
No files matched your search
@@ -150,6 +150,9 @@ class BeamlineConfig:
|
||||
expiry_sec: int,
|
||||
) -> OpenGuiSessionInfo:
|
||||
existing = self._read_gui_session(session)
|
||||
holder = self.baton_holder
|
||||
holds_baton = bool(holder is not None and holder.session == session)
|
||||
|
||||
payload = OpenGuiSessionInfo(
|
||||
session=session,
|
||||
username=username,
|
||||
@@ -160,7 +163,7 @@ class BeamlineConfig:
|
||||
close_requested_by=existing.close_requested_by if existing is not None else None,
|
||||
close_requested_at=existing.close_requested_at if existing is not None else None,
|
||||
close_grace_seconds=existing.close_grace_seconds if existing is not None else None,
|
||||
holds_baton=existing.holds_baton if existing is not None else False,
|
||||
holds_baton=holds_baton,
|
||||
)
|
||||
|
||||
self._write_gui_session(payload, expiry_sec=expiry_sec)
|
||||
|
||||
@@ -335,9 +335,9 @@ async def status(token: str = Depends(oauth2_scheme)) -> DAQStatusModel:
|
||||
full.last_best_b_factor = full.last_best_b_factor if in_ro else None
|
||||
full.crystal_size = full.crystal_size if in_ro else CrystalSize(x=0,y=0,z=0)
|
||||
full.session = SessionStatus(
|
||||
current_pgroup=cfg.pgroup,
|
||||
session=cfg.session_state(data.session),
|
||||
staff=data.staff
|
||||
current_pgroup=cfg.pgroup,
|
||||
session=cfg.session_state(data.session),
|
||||
staff=data.staff
|
||||
)
|
||||
|
||||
if data.staff:
|
||||
|
||||
@@ -557,7 +557,7 @@ class DeveloperHelpDialog(QDialog):
|
||||
str(session.session),
|
||||
session.username,
|
||||
"Yes" if session.staff else "No",
|
||||
"Yes" if session.holds_baton else "No",
|
||||
"Yes" if getattr(session, "holds_baton", False) else "No",
|
||||
self._format_age(session.last_seen_ts),
|
||||
self._format_age(session.last_interaction_ts),
|
||||
"Yes" if session.close_requested else "No",
|
||||
|
||||
Reference in new issue
Block a user