mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-08-22 15:05:16 +00:00
perf: yield to event loop before heavy SQLite query
Adds a setTimeout(0) before parseBubbles so Ink can render the Loading state before the synchronous query blocks.
This commit is contained in:
parent
b7b7b2c7d6
commit
5ead1e9c07
1 changed files with 2 additions and 0 deletions
|
|
@ -179,6 +179,8 @@ function createParser(source: SessionSource, seenKeys: Set<string>): SessionPars
|
|||
&& dbSize >= cache.dbSizeBytes
|
||||
const afterTimestamp = cacheValid ? cache.lastCreatedAt : undefined
|
||||
|
||||
await new Promise(r => setTimeout(r, 0))
|
||||
|
||||
const { calls, maxCreatedAt } = parseBubbles(db, seenKeys, afterTimestamp)
|
||||
|
||||
if (maxCreatedAt > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue