* Heal a stale database handle in place. If `.codegraph/` was removed and * recreated at the SAME path while this instance held the DB open — a git * worktree removed and re-added, or `rm -rf .codegraph` + `codegraph init` — * our open fd points at the now-unlinked inode and can never see t
()
| 379 | * replaced file is still picked up — by that sync, or by the caller's retry. |
| 380 | */ |
| 381 | reopenIfReplaced(): boolean { |
| 382 | if (this.indexMutex.isLocked()) return false; |
| 383 | return this.reopenReplacedDatabase(); |
| 384 | } |
| 385 | |
| 386 | /** The body of {@link reopenIfReplaced}, without the in-flight-sync guard. */ |
| 387 | private reopenReplacedDatabase(): boolean { |
no test coverage detected