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

Function commitAndBeginNew

packages/node-runtime/src/import/streaming-importer.ts:252–274  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

250 }
251
252 const commitAndBeginNew = () => {
253 if (inTransaction) {
254 db.exec('COMMIT')
255 inTransaction = false
256 logger?.perf('Commit transaction', totalMessageCount, BATCH_COMMIT_SIZE)
257
258 if (totalMessageCount - lastCheckpointCount >= CHECKPOINT_INTERVAL) {
259 doCheckpoint()
260 logger?.perf('WAL checkpoint', totalMessageCount)
261 lastCheckpointCount = totalMessageCount
262 }
263
264 onProgress({
265 stage: 'importing',
266 bytesRead: 0,
267 totalBytes: 0,
268 messagesProcessed: totalMessageCount,
269 percentage: 100,
270 message: '',
271 })
272 }
273 beginTransaction()
274 }
275
276 beginTransaction()
277

Callers 1

streamImportSingleFunction · 0.85

Calls 5

doCheckpointFunction · 0.85
beginTransactionFunction · 0.85
perfMethod · 0.80
execMethod · 0.65
onProgressFunction · 0.50

Tested by

no test coverage detected