mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-05-13 16:47:38 -03:00
fix(persistent-cache): persist scanner cache after model deletion
After deleting a model, the in-memory scanner cache was updated but the SQLite persistent cache was not. On server restart, the stale persistent cache caused check_model_version_exists() to return True, blocking re-download with 'Model version already exists'. Add _persist_current_cache() calls in both deletion paths: - ModelLifecycleService.delete_model() (used by versions tab delete) - delete_model_version handler in MiscHandlers
This commit is contained in:
@@ -111,6 +111,11 @@ class ModelLifecycleService:
|
||||
self._scanner._hash_index.remove_by_path(file_path)
|
||||
|
||||
await self._sync_update_for_model(model_id)
|
||||
|
||||
persist_current_cache = getattr(self._scanner, "_persist_current_cache", None)
|
||||
if callable(persist_current_cache):
|
||||
await persist_current_cache()
|
||||
|
||||
return {"success": True, "deleted_files": deleted_files}
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user