mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -03:00
refactor(cache): reorganize cache directory structure with automatic legacy cleanup
- Centralize cache path resolution in new py/utils/cache_paths.py module
- Migrate legacy cache files to organized structure: {settings_dir}/cache/{model|recipe|fts|symlink}/
- Automatically clean up legacy files after successful migration with integrity verification
- Update Config symlink cache to use new path and migrate from old location
- Simplify service classes (PersistentModelCache, PersistentRecipeCache, RecipeFTSIndex, TagFTSIndex) to use centralized migration logic
- Add comprehensive test coverage for cache paths and automatic cleanup
This commit is contained in:
@@ -37,7 +37,7 @@ def test_portable_settings_use_project_root(tmp_path, monkeypatch):
|
||||
monkeypatch.delenv("LORA_MANAGER_CACHE_DB", raising=False)
|
||||
|
||||
cache = cache_module.PersistentModelCache(library_name="portable_lib")
|
||||
expected_cache_path = tmp_path / "model_cache" / "portable_lib.sqlite"
|
||||
expected_cache_path = tmp_path / "cache" / "model" / "portable_lib.sqlite"
|
||||
|
||||
assert cache.get_database_path() == str(expected_cache_path)
|
||||
assert expected_cache_path.parent.is_dir()
|
||||
|
||||
Reference in New Issue
Block a user