Enhance model caching and exclusion functionality: update cache version, add excluded models to cache data, and ensure cache is saved to disk after model exclusion and deletion.

This commit is contained in:
Will Miao
2025-06-04 18:38:45 +08:00
parent 641fa8a3d9
commit 9fc2fb4d17
4 changed files with 27 additions and 2 deletions

View File

@@ -303,6 +303,8 @@ class ModelRouteUtils:
# Update hash index if available
if hasattr(scanner, '_hash_index') and scanner._hash_index:
scanner._hash_index.remove_by_path(file_path)
await scanner._save_cache_to_disk()
return web.json_response({
'success': True,
@@ -484,6 +486,8 @@ class ModelRouteUtils:
# Add to excluded models list
scanner._excluded_models.append(file_path)
await scanner._save_cache_to_disk()
return web.json_response({
'success': True,