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")
|
custom_limit = _getenv_optional_int("LIMIT")
|
||||||
if custom_limit is not None and custom_limit > 0:
|
if custom_limit is not None and custom_limit > 0:
|
||||||
return custom_limit, "smart"
|
return custom_limit, "smart"
|
||||||
if custom_limit == 0:
|
if custom_limit is not None and custom_limit <= 0:
|
||||||
logger.warning("LIMIT=0 is invalid — ignoring and using auto strategy")
|
logger.warning("LIMIT=%s is invalid — ignoring and using auto strategy", custom_limit)
|
||||||
|
|
||||||
strategy_map = {
|
strategy_map = {
|
||||||
"adaptive": ("auto", "smart"),
|
"adaptive": ("auto", "smart"),
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ def begin_batch(filename: str) -> None:
|
|||||||
"""
|
"""
|
||||||
path = _tracker_path(filename)
|
path = _tracker_path(filename)
|
||||||
key = str(path)
|
key = str(path)
|
||||||
if key in _deferred and key in _cache:
|
if key in _deferred and key in _dirty:
|
||||||
try:
|
try:
|
||||||
_write_to_disk(path, _cache[key])
|
_write_to_disk(path, _cache[key])
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Reference in New Issue
Block a user