Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenyoung committed Oct 31, 2024
2 parents ff8b736 + 90dc850 commit 497cf43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/manifest-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ const ManifestStore = async ({ ipfs, storage } = {}) => {
*/

storage = storage || await ComposedStorage(
await LRUStorage({ size: 1000 }),
await LRUStorage({ size: 100000 }),
await IPFSBlockStorage({ ipfs, pin: true })
)

const get = async (address) => {
const bytes = await storage.get(address)
const { value } = await Block.decode({ bytes, codec, hasher })
if (value) {
// Write to storage to make sure it gets pinned on IPFS
await storage.put(address, bytes)
}
return value
}

Expand Down
2 changes: 2 additions & 0 deletions src/oplog/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ const Log = async (identity, { logId, logHeads, access, entryStorage, headsStora
/* 6. Add the new entry to heads (=union with current heads) */
await _heads.add(entry)

await _entries.put(entry.hash, entry.bytes)

return true
}

Expand Down

0 comments on commit 497cf43

Please sign in to comment.