MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / postImportHook

Function postImportHook

apps/desktop/main/worker/import/incrementalImport.ts:45–59  ·  view source on GitHub ↗
(_db, sessionId)

Source from the content-addressed store, hash-verified

43 sendProgress(requestId, progress)
44 },
45 postImportHook(_db, sessionId) {
46 const cacheDir = getCacheDir()
47 try {
48 const dbPath = getDbPath(sessionId)
49 const rawDb = new Database(dbPath)
50 computeAndSetOverviewCache(new BetterSqliteAdapter(rawDb), sessionId, cacheDir)
51 rawDb.close()
52 } catch (err) {
53 // Non-fatal: getValidatedOverviewCache will recompute on next read.
54 console.warn('[Worker] postImportHook: failed to refresh overview cache', err)
55 }
56 if (cacheDir) {
57 deleteSessionCache(sessionId, path.join(cacheDir, 'query'))
58 }
59 },
60 }
61}
62

Callers

nothing calls this directly

Calls 6

getCacheDirFunction · 0.90
getDbPathFunction · 0.90
deleteSessionCacheFunction · 0.90
closeMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected