()
| 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 |
no test coverage detected