Skip to content

Commit 08523de

Browse files
committed
refactor(add_coordinator): drop unused rollback_error_message field
AddMutationPlan.rollback_error_message had zero callers — every construction site (cli.py x2, tests x6) used the default. Remove the field and inline the literal at its single read site.
1 parent ac80040 commit 08523de

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

openkb/add_coordinator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class AddMutationPlan:
4848
post_commit_hooks: Sequence[PostCommitHook] = field(default_factory=tuple)
4949
hardlink_dirs: set[Path] = field(default_factory=set)
5050
staging_dirs: Sequence[Path | None] = field(default_factory=tuple)
51-
rollback_error_message: str = "Rollback failed; mutation journal retained for recovery"
5251

5352

5453
def _cleanup_staging_dirs(staging_dirs: Sequence[Path | None]) -> None:
@@ -73,7 +72,10 @@ def _rollback_snapshot(plan: AddMutationPlan, snapshot) -> Path | None:
7372
if rollback_error is None:
7473
snapshot.discard_best_effort()
7574
else:
76-
click.echo(f" [ERROR] {plan.rollback_error_message}: {snapshot.journal_path}")
75+
click.echo(
76+
" [ERROR] Rollback failed; mutation journal retained for recovery: "
77+
f"{snapshot.journal_path}"
78+
)
7779
_cleanup_staging_dirs(plan.staging_dirs)
7880
return snapshot.journal_path if rollback_error is not None else None
7981

0 commit comments

Comments
 (0)