From e25a46c892fdb547b7e3d93a63f06c0fdccc8692 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 29 Oct 2024 14:58:00 -0700 Subject: [PATCH] fix: wrap TAGS_CACHE length check in try/except block for SQLite errors --- aider/repomap.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aider/repomap.py b/aider/repomap.py index 19abf1e2d..f2e6c5b0a 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -318,7 +318,13 @@ class RepoMap: # https://networkx.org/documentation/stable/_modules/networkx/algorithms/link_analysis/pagerank_alg.html#pagerank personalize = 100 / len(fnames) - if len(fnames) - len(self.TAGS_CACHE) > 100: + try: + cache_size = len(self.TAGS_CACHE) + except SQLITE_ERRORS: + self.tags_cache_error() + cache_size = len(self.TAGS_CACHE) + + if len(fnames) - cache_size > 100: self.io.tool_output( "Initial repo scan can be slow in larger repos, but only happens once." )