mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-08-25 18:32:35 +08:00
Skip every write for a reference the reset cannot classify
A reference whose path is under no configured root is meant to be left alone entirely, but needs_verify was decided before the classification guard, so it was the one write of four that did not skip. Classification now comes first, which also stops an out-of-view row being counted as changed or unchanged when the reset did nothing with it either way. Stamping the version was also the only database access in the runner that could throw into its caller, so a transient lock while stamping aborted the seeder's whole scan -- prune, fast phase and enrichment -- over a step whose own writes were already committed. A failed stamp is now logged and leaves the step pending, like every other failure there.
This commit is contained in:
@@ -101,9 +101,18 @@ def run_pending_semantics_steps(interrupt_check: InterruptCheck | None = None) -
|
||||
)
|
||||
return applied
|
||||
|
||||
with create_session() as session:
|
||||
set_semantics_version(session, step.version)
|
||||
session.commit()
|
||||
try:
|
||||
with create_session() as session:
|
||||
set_semantics_version(session, step.version)
|
||||
session.commit()
|
||||
except Exception:
|
||||
logging.exception(
|
||||
"Asset semantics step %d (%s) finished but could not be stamped, "
|
||||
"so it runs again; its own writes are already committed",
|
||||
step.version,
|
||||
step.description,
|
||||
)
|
||||
return applied
|
||||
|
||||
applied += 1
|
||||
logging.info(
|
||||
|
||||
@@ -129,14 +129,6 @@ def _reproject_batch(
|
||||
summary.absent_files += 1
|
||||
continue
|
||||
|
||||
if unchanged:
|
||||
summary.unchanged_files += 1
|
||||
else:
|
||||
# Hand it to the verify path rather than re-read the file for hash and size.
|
||||
summary.changed_files += 1
|
||||
if not row.needs_verify:
|
||||
set_needs_verify.append(row.reference_id)
|
||||
|
||||
try:
|
||||
derived_tags = set(
|
||||
normalize_tags(get_path_derived_tags_from_path(row.file_path))
|
||||
@@ -145,6 +137,14 @@ def _reproject_batch(
|
||||
summary.unclassified_paths += 1
|
||||
continue
|
||||
|
||||
if unchanged:
|
||||
summary.unchanged_files += 1
|
||||
else:
|
||||
# Hand it to the verify path rather than re-read the file for hash and size.
|
||||
summary.changed_files += 1
|
||||
if not row.needs_verify:
|
||||
set_needs_verify.append(row.reference_id)
|
||||
|
||||
loader_path = compute_loader_path(row.file_path)
|
||||
if loader_path != row.loader_path:
|
||||
loader_paths[row.reference_id] = loader_path
|
||||
|
||||
Reference in New Issue
Block a user