Skip to content

Commit

Permalink
fix: blockly index key (#53)
Browse files Browse the repository at this point in the history
The index key changed to accommodate multiple indexes of block in
different CAR shards.
  • Loading branch information
Alan Shaw authored Jun 22, 2023
1 parent 8778a7a commit 2217fe5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/car-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class BlocklyIndex {
const key = mhToString(cid.multihash)
if (this.#indexes.has(key)) return

const res = await this.#bucket.get(`${key}/${key}.idx`)
const res = await this.#bucket.get(`${key}/.idx`)
if (!res) return

const reader = MultiIndexReader.createReader({ reader: res.body.getReader() })
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class Builder {
}

for (const [blockMh, offsets] of blockIndex) {
const key = `${blockMh}/${blockMh}.idx`
const key = `${blockMh}/.idx`

const [parentShard, offset] = getAnyMapEntry(offsets)
/** @type {Map<ShardCID, Map<MultihashString, Offset>>} */
Expand Down

0 comments on commit 2217fe5

Please sign in to comment.