Skip to content

Commit

Permalink
ensure we have system record for each linearizer pre ff (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
chm-diederichs authored Jun 13, 2024
1 parent b285df3 commit a0575f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ module.exports = class Autobase extends ReadyResource {
if (length === 0) continue
const core = this.store.get(key)
await core.ready()
indexers.push({ core, length })
indexers.push({ key, core, length })
}

// handle rest of views
Expand All @@ -1497,8 +1497,9 @@ module.exports = class Autobase extends ReadyResource {

const promises = []

for (const { core, length } of indexers) {
for (const { key, core, length } of indexers) {
if (core.length === 0 && length > 0) promises.push(core.get(length - 1, { timeout }))
promises.push(system.get(key))
}

for (const { core, length } of pendingViews) {
Expand Down

0 comments on commit a0575f3

Please sign in to comment.