Skip to content

Commit 12ab53a

Browse files
Don't close database until search map hooks are called (#831)
1 parent 8f00dbf commit 12ab53a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/murfey/workflows/tomo/tomo_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,6 @@ def register_search_map_in_database(
243243
)
244244
murfey_db.add(search_map)
245245
murfey_db.commit()
246-
if close_db:
247-
murfey_db.close()
248246

249247
if search_map_hooks := entry_points(group="murfey.hooks", name="search_map"):
250248
try:
@@ -257,6 +255,8 @@ def register_search_map_in_database(
257255
)
258256
except Exception as e:
259257
logger.error(f"Call to search map hook failed with {e}", exc_info=True)
258+
if close_db:
259+
murfey_db.close()
260260

261261

262262
def register_batch_position_in_database(

0 commit comments

Comments
 (0)