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

Method foldNow

src/db/wal-valve.ts:211–217  ·  view source on GitHub ↗

* Phase-boundary fold: backfill the ENTIRE WAL now (off-thread, awaited). * Called between bulk phases — e.g. after parsing, before resolution's * first reads — so the next phase never pages a bulk-write-sized WAL on * the main thread (the post-parse read against a multi-GB WAL is what *

()

Source from the content-addressed store, hash-verified

209 * keeps the event loop (and the watchdog heartbeat) turning.
210 */
211 async foldNow(): Promise<void> {
212 await this.drain();
213 if (this.growthBytes() <= 0) return;
214 this.log(`foldNow: wal=${this.mb(this.db.getWalSizeBytes())} baseline=${this.mb(this.sizeAtLastFullBackfill)}`);
215 this.pause = this.backfillFully().finally(() => { this.pause = null; });
216 await this.pause;
217 }
218
219 /**
220 * With the writer parked on the returned promise, loop passive passes until

Callers 3

indexAllMethod · 0.80
syncMethod · 0.80

Calls 5

drainMethod · 0.95
growthBytesMethod · 0.95
mbMethod · 0.95
backfillFullyMethod · 0.95
getWalSizeBytesMethod · 0.80

Tested by

no test coverage detected