fix: address 2 quality review findings — begin_batch dirty guard, LIMIT<=0 warning

This commit is contained in:
2026-06-16 18:04:38 +00:00
parent 54b52b0a73
commit e8cb390fe4
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ def _resolve_strategy(strategy: str, has_embedding: bool) -> tuple[int | str, st
custom_limit = _getenv_optional_int("LIMIT")
if custom_limit is not None and custom_limit > 0:
return custom_limit, "smart"
if custom_limit == 0:
logger.warning("LIMIT=0 is invalid — ignoring and using auto strategy")
if custom_limit is not None and custom_limit <= 0:
logger.warning("LIMIT=%s is invalid — ignoring and using auto strategy", custom_limit)
strategy_map = {
"adaptive": ("auto", "smart"),
+1 -1
View File
@@ -105,7 +105,7 @@ def begin_batch(filename: str) -> None:
"""
path = _tracker_path(filename)
key = str(path)
if key in _deferred and key in _cache:
if key in _deferred and key in _dirty:
try:
_write_to_disk(path, _cache[key])
except Exception: