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

Method getFilesIndexedSince

src/db/queries.ts:4332–4340  ·  view source on GitHub ↗

* Files re-indexed strictly after `since` (ms since epoch), newest first. * * `total` is the real count; `paths` is capped at `limit`. Used by the * viewer's live channel to name what a sync just picked up. A file the same * sync DELETED cannot appear here — it has no row left — which is

(since: number, limit: number)

Source from the content-addressed store, hash-verified

4330 * empty list as "nothing happened".
4331 */
4332 getFilesIndexedSince(since: number, limit: number): { paths: string[]; total: number } {
4333 const count = this.db
4334 .prepare('SELECT COUNT(*) AS n FROM files WHERE indexed_at > ?')
4335 .get(since) as { n: number } | undefined;
4336 const rows = this.db
4337 .prepare('SELECT path FROM files WHERE indexed_at > ? ORDER BY indexed_at DESC, path LIMIT ?')
4338 .all(since, Math.max(0, limit)) as Array<{ path: string }>;
4339 return { paths: rows.map((r) => r.path), total: count?.n ?? rows.length };
4340 }
4341
4342 /**
4343 * Get files that need re-indexing (hash changed)

Callers 1

checkIndexMethod · 0.45

Calls 4

mapMethod · 0.80
getMethod · 0.65
prepareMethod · 0.65
allMethod · 0.65

Tested by

no test coverage detected