mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 15:15:44 -03:00
Update cache management in ApiRoutes to remove hash index by file path
- Added functionality to update the hash index by removing entries associated with the specified file path during cache management. - Ensured that the cache is properly resorted after the removal of raw data items.
This commit is contained in:
@@ -269,6 +269,9 @@ class ApiRoutes:
|
|||||||
cache = await self.scanner.get_cached_data()
|
cache = await self.scanner.get_cached_data()
|
||||||
cache.raw_data = [item for item in cache.raw_data if item['file_path'] != main_path]
|
cache.raw_data = [item for item in cache.raw_data if item['file_path'] != main_path]
|
||||||
await cache.resort()
|
await cache.resort()
|
||||||
|
|
||||||
|
# update hash index
|
||||||
|
self.scanner._hash_index.remove_by_path(main_path)
|
||||||
|
|
||||||
# Delete optional files
|
# Delete optional files
|
||||||
for pattern in patterns[1:]:
|
for pattern in patterns[1:]:
|
||||||
|
|||||||
Reference in New Issue
Block a user