* 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
()
| 373 | * replaced file is still picked up — by that sync, or by the caller's retry. |
| 374 | */ |
| 375 | reopenIfReplaced(): boolean { |
| 376 | if (this.indexMutex.isLocked()) return false; |
| 377 | return this.reopenReplacedDatabase(); |
| 378 | } |
| 379 | |
| 380 | /** The body of {@link reopenIfReplaced}, without the in-flight-sync guard. */ |
| 381 | private reopenReplacedDatabase(): boolean { |
no test coverage detected