mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-25 09:24:07 +00:00
refactor: move bulk_ops to queries and scanner service
- Delete bulk_ops.py, moving logic to appropriate layers - Add bulk insert query functions: - queries/asset.bulk_insert_assets - queries/cache_state.bulk_insert_cache_states_ignore_conflicts - queries/cache_state.get_cache_states_by_paths_and_asset_ids - queries/asset_info.bulk_insert_asset_infos_ignore_conflicts - queries/asset_info.get_asset_info_ids_by_ids - queries/tags.bulk_insert_tags_and_meta - Move seed_from_paths_batch orchestration to scanner._seed_from_paths_batch Amp-Thread-ID: https://ampcode.com/threads/T-019c24fd-157d-776a-ad24-4f19cf5d3afe Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -5,6 +5,7 @@ from app.assets.database.queries.asset import (
|
||||
asset_exists_by_hash,
|
||||
get_asset_by_hash,
|
||||
upsert_asset,
|
||||
bulk_insert_assets,
|
||||
)
|
||||
|
||||
from app.assets.database.queries.asset_info import (
|
||||
@@ -20,6 +21,8 @@ from app.assets.database.queries.asset_info import (
|
||||
replace_asset_info_metadata_projection,
|
||||
delete_asset_info_by_id,
|
||||
set_asset_info_preview,
|
||||
bulk_insert_asset_infos_ignore_conflicts,
|
||||
get_asset_info_ids_by_ids,
|
||||
)
|
||||
|
||||
from app.assets.database.queries.cache_state import (
|
||||
@@ -33,6 +36,8 @@ from app.assets.database.queries.cache_state import (
|
||||
bulk_set_needs_verify,
|
||||
delete_cache_states_by_ids,
|
||||
delete_orphaned_seed_asset,
|
||||
bulk_insert_cache_states_ignore_conflicts,
|
||||
get_cache_states_by_paths_and_asset_ids,
|
||||
)
|
||||
|
||||
from app.assets.database.queries.tags import (
|
||||
@@ -44,6 +49,7 @@ from app.assets.database.queries.tags import (
|
||||
add_missing_tag_for_asset_id,
|
||||
remove_missing_tag_for_asset_id,
|
||||
list_tags_with_usage,
|
||||
bulk_insert_tags_and_meta,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
@@ -51,6 +57,7 @@ __all__ = [
|
||||
"asset_exists_by_hash",
|
||||
"get_asset_by_hash",
|
||||
"upsert_asset",
|
||||
"bulk_insert_assets",
|
||||
# asset_info.py
|
||||
"asset_info_exists_for_asset_id",
|
||||
"get_asset_info_by_id",
|
||||
@@ -64,6 +71,8 @@ __all__ = [
|
||||
"replace_asset_info_metadata_projection",
|
||||
"delete_asset_info_by_id",
|
||||
"set_asset_info_preview",
|
||||
"bulk_insert_asset_infos_ignore_conflicts",
|
||||
"get_asset_info_ids_by_ids",
|
||||
# cache_state.py
|
||||
"CacheStateRow",
|
||||
"list_cache_states_by_asset_id",
|
||||
@@ -75,6 +84,8 @@ __all__ = [
|
||||
"bulk_set_needs_verify",
|
||||
"delete_cache_states_by_ids",
|
||||
"delete_orphaned_seed_asset",
|
||||
"bulk_insert_cache_states_ignore_conflicts",
|
||||
"get_cache_states_by_paths_and_asset_ids",
|
||||
# tags.py
|
||||
"ensure_tags_exist",
|
||||
"get_asset_tags",
|
||||
@@ -84,4 +95,5 @@ __all__ = [
|
||||
"add_missing_tag_for_asset_id",
|
||||
"remove_missing_tag_for_asset_id",
|
||||
"list_tags_with_usage",
|
||||
"bulk_insert_tags_and_meta",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user