Skip to content

Commit 46da8d3

Browse files
author
Dylan Huang
committed
Implement cache clearing in TinyDBEvaluationRowStore to ensure fresh reads in multi-process scenarios
1 parent 2afaa53 commit 46da8d3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

eval_protocol/dataset_logger/tinydb_evaluation_row_store.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def upsert_row(self, data: dict) -> None:
4242
# tinyrecord doesn't support upsert directly, so we implement it manually
4343
# within a transaction for atomicity
4444
with transaction(self._table) as tr:
45+
# Clear cache to ensure fresh read in multi-process scenarios
46+
self._table.clear_cache()
4547
# Check if document exists
4648
existing = self._table.search(condition)
4749
if existing:

0 commit comments

Comments
 (0)