mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-29 10:51:27 +00:00
Fix is_missing state updates for asset cache states on startup
- Add bulk_update_is_missing() to efficiently update is_missing flag - Update sync_cache_states_with_filesystem() to mark non-existent files as is_missing=True - Call restore_cache_states_by_paths() in batch_insert_seed_assets() to restore previously-missing states when files reappear during scanning Amp-Thread-ID: https://ampcode.com/threads/T-019c3177-e591-7666-ac6b-7e05c71c8ebf Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -18,6 +18,7 @@ from app.assets.database.queries import (
|
||||
get_cache_states_by_paths_and_asset_ids,
|
||||
get_unreferenced_unhashed_asset_ids,
|
||||
mark_cache_states_missing_outside_prefixes,
|
||||
restore_cache_states_by_paths,
|
||||
)
|
||||
from app.assets.helpers import get_utc_now
|
||||
|
||||
@@ -201,6 +202,7 @@ def batch_insert_seed_assets(
|
||||
|
||||
bulk_insert_assets(session, asset_rows)
|
||||
bulk_insert_cache_states_ignore_conflicts(session, cache_state_rows)
|
||||
restore_cache_states_by_paths(session, absolute_path_list)
|
||||
winning_paths = get_cache_states_by_paths_and_asset_ids(session, path_to_asset_id)
|
||||
|
||||
all_paths_set = set(absolute_path_list)
|
||||
|
||||
Reference in New Issue
Block a user