MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / reopenIfReplaced

Method reopenIfReplaced

src/index.ts:377–380  ·  view source on GitHub ↗

* 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

()

Source from the content-addressed store, hash-verified

375 * replaced file is still picked up — by that sync, or by the caller's retry.
376 */
377 reopenIfReplaced(): boolean {
378 if (this.indexMutex.isLocked()) return false;
379 return this.reopenReplacedDatabase();
380 }
381
382 /** The body of {@link reopenIfReplaced}, without the in-flight-sync guard. */
383 private reopenReplacedDatabase(): boolean {

Calls 2

isLockedMethod · 0.80

Tested by

no test coverage detected