mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
refactor: Optimize cache key generation in RepoMap class
This commit is contained in:
parent
90e42045df
commit
8b6b558483
1 changed files with 9 additions and 4 deletions
|
@ -457,13 +457,18 @@ class RepoMap:
|
||||||
force_refresh=False,
|
force_refresh=False,
|
||||||
):
|
):
|
||||||
# Create a cache key
|
# Create a cache key
|
||||||
cache_key = (
|
cache_key = [
|
||||||
tuple(sorted(chat_fnames)) if chat_fnames else None,
|
tuple(sorted(chat_fnames)) if chat_fnames else None,
|
||||||
tuple(sorted(other_fnames)) if other_fnames else None,
|
tuple(sorted(other_fnames)) if other_fnames else None,
|
||||||
max_map_tokens,
|
max_map_tokens,
|
||||||
tuple(sorted(mentioned_fnames)) if mentioned_fnames else None,
|
]
|
||||||
tuple(sorted(mentioned_idents)) if mentioned_idents else None,
|
|
||||||
)
|
if self.refresh == "auto":
|
||||||
|
cache_key += [
|
||||||
|
tuple(sorted(mentioned_fnames)) if mentioned_fnames else None,
|
||||||
|
tuple(sorted(mentioned_idents)) if mentioned_idents else None,
|
||||||
|
]
|
||||||
|
cache_key = tuple(cache_key)
|
||||||
|
|
||||||
use_cache = False
|
use_cache = False
|
||||||
if not force_refresh:
|
if not force_refresh:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue