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

Function postImportHook

apps/desktop/main/worker/import/streamImport.ts:92–105  ·  view source on GitHub ↗
(_db, sessionId)

Source from the content-addressed store, hash-verified

90 },
91 logger: buildElectronLogger(),
92 postImportHook(_db, sessionId) {
93 const cacheDir = getCacheDir()
94 try {
95 const dbPath = getDbPath(sessionId)
96 const rawDb = new Database(dbPath)
97 computeAndSetOverviewCache(new BetterSqliteAdapter(rawDb), sessionId, cacheDir)
98 rawDb.close()
99 } catch (err) {
100 console.warn('[Worker] postImportHook: failed to refresh overview cache', err)
101 }
102 if (cacheDir) {
103 deleteSessionCache(sessionId, path.join(cacheDir, 'query'))
104 }
105 },
106 generateSessionId,
107 }
108}

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