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

Method reopenIfReplaced

src/index.ts:375–378  ·  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

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 {

Calls 2

isLockedMethod · 0.80

Tested by

no test coverage detected