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

Method getFilesIndexedSince

src/db/queries.ts:4443–4451  ·  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

4441 * empty list as "nothing happened".
4442 */
4443 getFilesIndexedSince(since: number, limit: number): { paths: string[]; total: number } {
4444 const count = this.db
4445 .prepare('SELECT COUNT(*) AS n FROM files WHERE indexed_at > ?')
4446 .get(since) as { n: number } | undefined;
4447 const rows = this.db
4448 .prepare('SELECT path FROM files WHERE indexed_at > ? ORDER BY indexed_at DESC, path LIMIT ?')
4449 .all(since, Math.max(0, limit)) as Array<{ path: string }>;
4450 return { paths: rows.map((r) => r.path), total: count?.n ?? rows.length };
4451 }
4452
4453 /**
4454 * 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