fix: Reduce number of cache warming pings

This commit is contained in:
Paul Gauthier 2024-08-26 16:30:07 -07:00 committed by Paul Gauthier (aider)
parent 27e854708a
commit c760b61cf5

View file

@ -90,7 +90,7 @@ class Coder:
message_tokens_received = 0 message_tokens_received = 0
add_cache_headers = False add_cache_headers = False
cache_warming_thread = None cache_warming_thread = None
num_cache_warming_pings = 5 num_cache_warming_pings = 0
@classmethod @classmethod
def create( def create(
@ -260,6 +260,8 @@ class Coder:
self.rejected_urls = set() self.rejected_urls = set()
self.abs_root_path_cache = {} self.abs_root_path_cache = {}
self.num_cache_warming_pings = num_cache_warming_pings
if not fnames: if not fnames:
fnames = [] fnames = []
@ -992,7 +994,7 @@ class Coder:
if not self.num_cache_warming_pings: if not self.num_cache_warming_pings:
return return
delay = 5 * 60 - 10 delay = 5 * 60 - 5
self.next_cache_warm = time.time() + delay self.next_cache_warm = time.time() + delay
self.warming_pings_left = self.num_cache_warming_pings self.warming_pings_left = self.num_cache_warming_pings
self.cache_warming_chunks = chunks self.cache_warming_chunks = chunks