fix(auto-commit-service): 🐛 auto-refresh cache on "Repository not found" errors

This commit is contained in:
Lilith 2026-01-05 02:25:20 -08:00
parent 7bb415783e
commit 121816bc53
2 changed files with 20 additions and 0 deletions

View file

@ -390,6 +390,26 @@ class CommitDaemon:
f"{len(results) - repos_committed - repos_failed} unchanged"
)
# Auto-refresh cache if any "Repository not found" errors occurred
if self.settings.recursive_discovery and repos_failed > 0:
not_found_errors = [
r for r in results
if r.status == ProcessStatus.ERROR and
r.error and "not found" in r.error.lower()
]
if not_found_errors:
logger.warning(
f"Detected {len(not_found_errors)} missing repositories, "
f"refreshing cache..."
)
old_count = len(self.repos)
self.repos = self._discover_and_cache_repos()
new_count = len(self.repos)
logger.info(
f"Cache refreshed: {old_count} -> {new_count} repos "
f"({new_count - old_count:+d})"
)
return cycle_result
async def trigger_cycle(self) -> CycleResult: