fix: Save empty dict to cache file on download failure

This commit is contained in:
Paul Gauthier (aider) 2024-11-20 07:57:56 -08:00
parent 788956e86d
commit aac45097ca

View file

@ -754,10 +754,9 @@ class ModelInfoManager:
pass pass
except Exception as ex: except Exception as ex:
print(str(ex)) print(str(ex))
finally:
# Touch the cache file to update its mtime even if download failed
try: try:
self.cache_file.touch() # Save empty dict to cache file on failure
self.cache_file.write_text("{}")
except OSError: except OSError:
pass pass