Skip to content

Commit

Permalink
fix: remove unnecessary logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Shaw committed Aug 15, 2023
1 parent c59af62 commit 82467b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/lib/blockstore.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class BatchingR2Blockstore extends R2Blockstore {
}

async #processBatch () {
console.log('processing batch')
// console.log('processing batch')
const batcher = this.#batcher
this.#batcher = new OrderedCarBlockBatcher()
const pendingBlocks = this.#pendingBlocks
Expand All @@ -110,7 +110,7 @@ export class BatchingR2Blockstore extends R2Blockstore {
length: batch[batch.length - 1].offset - batch[0].offset + MAX_ENCODED_BLOCK_LENGTH
}

console.log(`fetching ${batch.length} blocks from ${carCid} (${range.length} bytes @ ${range.offset})`)
// console.log(`fetching ${batch.length} blocks from ${carCid} (${range.length} bytes @ ${range.offset})`)
const res = await this._dataBucket.get(carPath, { range })
if (!res) {
// should not happen, but if it does, we need to resolve `undefined`
Expand All @@ -130,7 +130,7 @@ export class BatchingR2Blockstore extends R2Blockstore {
}
})())

let resolvedBlocks = 0
// let resolvedBlocks = 0
while (true) {
try {
const blockHeader = await readBlockHead(bytesReader)
Expand All @@ -140,7 +140,7 @@ export class BatchingR2Blockstore extends R2Blockstore {
const key = mhToKey(blockHeader.cid.multihash.bytes)
const blocks = pendingBlocks.get(key)
if (blocks) {
resolvedBlocks++
// resolvedBlocks++
// console.log(`got wanted block for ${blockHeader.cid}`)
const block = {
cid: blockHeader.cid,
Expand Down Expand Up @@ -191,7 +191,7 @@ export class BatchingR2Blockstore extends R2Blockstore {
// Yield to allow GC to run - DO NOT REMOVE!
await new Promise(resolve => setTimeout(resolve))

console.log(`batcher efficiency ${resolvedBlocks}:1`)
// console.log(`batcher efficiency ${resolvedBlocks}:1`)
}

// resolve `undefined` for any remaining blocks
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dag-index/car.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class StreamingCarIndex {
// promised index because the real index is checked _first_.
const promises = this.#promisedIdx.get(key) || []
promises.forEach(({ resolve }) => {
console.log(`found requested entry before index finished building: ${key} => ${entry.offset}`)
// console.log(`found requested entry before index finished building: ${key} => ${entry.offset}`)
resolve(entry)
})
this.#promisedIdx.delete(key)
Expand Down

0 comments on commit 82467b4

Please sign in to comment.