Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

fix: add buffer and cleanup #22

Merged
merged 3 commits into from
Apr 6, 2020
Merged

fix: add buffer and cleanup #22

merged 3 commits into from
Apr 6, 2020

Conversation

hugomrdias
Copy link
Member

  • update deps
  • lint fixes
  • add buffer
  • fix tiered open
  • fix tiered has, fail test added also

- update deps
- lint fixes
- add buffer
- fix tiered open
- fix tiered `has`, fail test added also
}
}))
async has (key) {
for (const s of this.stores) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Promise.race here? The previous code looked through all nested stores in parallel, this makes it serial but it should never have waited for them all to complete before resolving to a value.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

race is weird (http://bluebirdjs.com/docs/api/promise.race.html), with https://github.com/sindresorhus/p-any we would need to try catch twice to return a boolean.
do you think its worth it ? this looks nice and simple

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semantics are a little convoluted. Let's merge this then we can look at refactoring it if it proves to be a bottleneck.

@achingbrain achingbrain merged commit f0f64a9 into master Apr 6, 2020
@achingbrain achingbrain deleted the fix/add-buffer branch April 6, 2020 07:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants