fix: address 2 quality review findings — begin_batch dirty guard, LIMIT<=0 warning
This commit is contained in:
+2
-2
@@ -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"),
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user