Skip to content

Commit 4813f6a

Browse files
fix: round-5 review — constant-time finalized check in missing finalization
The guard-skipped loop tested membership against the finalized list, scanning up to 200k dicts per missing item — quadratic job finalization that can appear hung on a large complete import. Test the item's source_key against the already-built marked_keys set instead.
1 parent ff4aba6 commit 4813f6a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

engraphis/obsidian_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def import_scan(
383383
planned_action="missing", result_state="missing",
384384
)
385385
for item in missing:
386-
if item in finalized:
386+
if str(item.get("source_key") or "") in marked_keys:
387387
continue
388388
# The generation guard left this row live: a concurrent import
389389
# refreshed it after this run planned it missing. The job history

0 commit comments

Comments
 (0)