Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update deps #6

Merged
merged 5 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/multi-core-indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ nanobench('Index 20 cores of 1000 blocks (10 times)', async (b) => {
await new Promise((res) => setTimeout(res, 10))
},
maxBatch: 500,
storage: () => ram(),
storage: () => new ram(),
})
await throttledIdle(indexer)
assert(count === expected.length)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/multifeed-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ nanobench('Index 20 cores of 1000 blocks (10 times)', async (b) => {
const storages = new Map()

function createStorage(key) {
const storage = storages.get(key) || ram()
const storage = storages.get(key) || new ram()
storages.set(key, storage)
return storage
}
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class MultiCoreIndexer extends TypedEmitter {
if (typeof storage !== 'string') return storage
const directory = storage
return function createFile(name) {
return raf(name, { directory })
return new raf(name, { directory })
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions lib/core-index-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ class CoreIndexStream extends Readable {
(await this[kPushEntry](index)) ||
/* istanbul ignore next - TODO: Test when hypercore-next supports a core.clear() method */
didPush
// This is for back-pressure, for which there is not a good test yet.
// The faster streamx state machine in https://github.com/mafintosh/streamx/pull/77
// caused this stream's read buffer to never fill with the current tests,
// so that this line is currently uncovered by tests.
// TODO: Add a test similar to 'Appends from a replicated core are indexed' in core-index-stream.test.js
// but pipe to a slow stream, to test back-pressure, which should result in coverage of this line.
/* istanbul ignore next */
if (!this.#readBufferAvailable) break
}
}
Expand Down
Loading