diff --git a/winnow/cache.py b/winnow/cache.py index b3ebf7d..6ce3126 100644 --- a/winnow/cache.py +++ b/winnow/cache.py @@ -90,7 +90,7 @@ class EmbeddingCache: np.save(tmp, embedding) os.replace(tmp, final) except Exception as e: - logger.debug("Cache write failed for %s: %s", asset_id, e) + logger.warning("Cache write failed for %s: %s", asset_id, e) try: os.remove(tmp) except OSError: diff --git a/winnow/executor.py b/winnow/executor.py index 656148b..8d1c2f9 100644 --- a/winnow/executor.py +++ b/winnow/executor.py @@ -507,6 +507,7 @@ def upload_to_frigate(jobs: list[dict]) -> None: asset_id = asset_map.get(fname) if asset_id: + tracker_ok = True try: mark_uploaded( asset_id, @@ -516,6 +517,7 @@ def upload_to_frigate(jobs: list[dict]) -> None: frigate_score=pre_fscore, ) except Exception as tracker_exc: + tracker_ok = False # Upload to Frigate succeeded — don't retry on tracker # failure or we'd upload a duplicate to Frigate. logger.error( @@ -523,9 +525,10 @@ def upload_to_frigate(jobs: list[dict]) -> None: " but asset may be re-selected next run: %s", fname, tracker_exc, ) - if pre_fscore is not None: - person_has_fscores = True - actually_uploaded.append((fname, asset_id)) + if tracker_ok: + if pre_fscore is not None: + person_has_fscores = True + actually_uploaded.append((fname, asset_id)) break else: diff --git a/winnow/jobs.py b/winnow/jobs.py index 50706e8..3449883 100644 --- a/winnow/jobs.py +++ b/winnow/jobs.py @@ -70,6 +70,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: + if custom_limit == 0: + logger.warning("LIMIT=0 selects zero images — set LIMIT to a positive integer or leave unset for auto") return custom_limit, "smart" strategy_map = {