-
Notifications
You must be signed in to change notification settings - Fork 167
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
fix: client close blockstore on store directory and store blob #1198
fix: client close blockstore on store directory and store blob #1198
Conversation
|
||
try { | ||
const { cid, car } = await NFTStorage.encodeBlob(blob, blockstore) | ||
await NFTStorage.storeCar(service, car) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can as an alternative do this within storeCar, but we would need to provide blockstore here, which feels odd as we don't even use ipfs-car
related things in the function. Also, wrapping everything to guarantee error handling looked the best option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, this can be redesigned as if a user want to store a big chunk, let's say 10GB, they need to have it available in tmpfs at once. I would recommend to have only the last pending blocks in the tmpfs and delete them after uploading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are working on a new solution to pack files that will stream directly instead of using a temporary blockstore to keep the blocks. So, this will be an enhancement that we will ship soon to improve this behaviour #980
Deploying with Cloudflare Pages
|
1616099
to
92eda73
Compare
92eda73
to
cbc9eee
Compare
Codecov Report
@@ Coverage Diff @@
## main #1198 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 1136 1169 +33
=========================================
+ Hits 1136 1169 +33
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Given we use a CarReader now, we can only close the blockstore once pack is finished.
Also updated @web-std/fetch to avoid
Error: Cannot find module '/home/runner/work/nft.storage/nft.storage/node_modules/@web-std/fetch/dist/index.cjs'
Closes #1186