mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
refactor: Implement once-per-second check for aider ignore file
This commit is contained in:
parent
33ff801f82
commit
a36861a01a
1 changed files with 8 additions and 1 deletions
|
@ -10,11 +10,14 @@ from aider.sendchat import simple_send_with_retries
|
||||||
from .dump import dump # noqa: F401
|
from .dump import dump # noqa: F401
|
||||||
|
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
class GitRepo:
|
class GitRepo:
|
||||||
repo = None
|
repo = None
|
||||||
aider_ignore_file = None
|
aider_ignore_file = None
|
||||||
aider_ignore_spec = None
|
aider_ignore_spec = None
|
||||||
aider_ignore_ts = 0
|
aider_ignore_ts = 0
|
||||||
|
aider_ignore_last_check = 0
|
||||||
subtree_only = False
|
subtree_only = False
|
||||||
ignore_file_cache = {}
|
ignore_file_cache = {}
|
||||||
|
|
||||||
|
@ -263,7 +266,11 @@ class GitRepo:
|
||||||
if not self.aider_ignore_file:
|
if not self.aider_ignore_file:
|
||||||
return
|
return
|
||||||
|
|
||||||
# todo: only recheck this once / second
|
current_time = time.time()
|
||||||
|
if current_time - self.aider_ignore_last_check < 1:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.aider_ignore_last_check = current_time
|
||||||
|
|
||||||
if not self.aider_ignore_file.is_file():
|
if not self.aider_ignore_file.is_file():
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue