From 788956e86d1ae5322e6bc2111dd9dc89b9351025 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 20 Nov 2024 07:56:28 -0800 Subject: [PATCH] refactor: Update cache TTL in ModelInfoManager even on download failure --- aider/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aider/models.py b/aider/models.py index b5cd9cd9f..73ed42300 100644 --- a/aider/models.py +++ b/aider/models.py @@ -754,6 +754,12 @@ class ModelInfoManager: pass except Exception as ex: print(str(ex)) + finally: + # Touch the cache file to update its mtime even if download failed + try: + self.cache_file.touch() + except OSError: + pass def get_model_from_cached_json_db(self, model): if not self.content: