Skip to content

Commit 0233f93

Browse files
committed
Fix consecutive annotations load bug.
1 parent bae6c2e commit 0233f93

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tiatoolbox/visualization/tileserver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def load_annotations(self: TileServer) -> str:
482482
file_path,
483483
np.array(model_mpp) / np.array(self.slide_mpps[session_id]),
484484
)
485-
tmp_path = Path(tempfile.gettempdir()) / "temp.db"
485+
tmp_path = Path(tempfile.gettempdir()) / f"temp_{session_id}.db"
486486
sq.dump(tmp_path)
487487
sq = SQLiteStore(tmp_path)
488488
self.pyramids[session_id]["overlay"] = AnnotationTileGenerator(
@@ -536,7 +536,7 @@ def change_overlay(self: TileServer) -> str:
536536
sq = SQLiteStore(overlay_path, auto_commit=False)
537537
else:
538538
# make a temporary db for the new annotations
539-
tmp_path = Path(tempfile.gettempdir()) / "temp.db"
539+
tmp_path = Path(tempfile.gettempdir()) / f"temp_{session_id}.db"
540540
sq.dump(tmp_path)
541541
sq = SQLiteStore(tmp_path)
542542

@@ -621,7 +621,7 @@ def commit_db(self: TileServer) -> str:
621621
if isinstance(layer, AnnotationTileGenerator):
622622
if (
623623
layer.store.path.suffix == ".db"
624-
and layer.store.path.name != "temp.db"
624+
and layer.store.path.name != f"temp_{session_id}.db"
625625
):
626626
logger.info("%s*.db committed.", layer.store.path.stem)
627627
layer.store.commit()

0 commit comments

Comments
 (0)