Skip to content

Commit 8f85bd6

Browse files
committed
check if smartem acquisition uuid is present for session to avoid creating a new one
1 parent e9f7b0a commit 8f85bd6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/murfey/server/api/instrument.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,12 @@ async def setup_multigrid_watcher(
162162
session = db.exec(select(Session).where(Session.id == session_id)).one()
163163
visit = session.visit
164164
async with aiohttp.ClientSession() as clientsession:
165-
acquisition_uuid = None
166-
if SMARTEM_ACTIVE and machine_config.smartem_api_url:
165+
acquisition_uuid = session.smartem_acquisition_uuid
166+
if (
167+
SMARTEM_ACTIVE
168+
and machine_config.smartem_api_url
169+
and acquisition_uuid is None
170+
):
167171
log.info("registering an acquisition with smartem")
168172
try:
169173
microscope_data = MicroscopeData(instrument_id=instrument_name)

0 commit comments

Comments
 (0)