This commit is contained in:
Timothy Jaeryang Baek
2026-06-16 23:24:27 +02:00
parent 56ae99e96a
commit 40c09167cd
5 changed files with 112 additions and 37 deletions
+5 -1
View File
@@ -368,7 +368,11 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
models_dict = {model['id']: model for model in models}
if isinstance(request.app.state.MODELS, RedisDict):
request.app.state.MODELS.set(models_dict)
try:
request.app.state.MODELS.set(models_dict)
except Exception as e:
log.warning(f'Failed to update Redis model cache, using in-process cache: {e}')
request.app.state.MODELS = models_dict
else:
request.app.state.MODELS = models_dict