Add feature to want() missing blobs
This commit is contained in:
parent
2c7b4ac130
commit
b18fdab014
|
@ -12,8 +12,9 @@ module.exports = async function imagePage ({ blobId, imageSize }) {
|
|||
return new Promise((resolve) => {
|
||||
pull(
|
||||
bufferSource,
|
||||
pull.collect((err, bufferArray) => {
|
||||
pull.collect(async (err, bufferArray) => {
|
||||
if (err) {
|
||||
await blob.want({ blobId })
|
||||
sharp({
|
||||
create: {
|
||||
width: imageSize,
|
||||
|
|
|
@ -8,5 +8,10 @@ module.exports = {
|
|||
debug('requested blob: %s', blobId)
|
||||
const ssb = await cooler.connect()
|
||||
return cooler.read(ssb.blobs.get, blobId)
|
||||
},
|
||||
want: async ({ blobId }) => {
|
||||
debug('requested blob: %s', blobId)
|
||||
const ssb = await cooler.connect()
|
||||
return cooler.get(ssb.blobs.want, blobId)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,9 @@ const rawConnect = () => new Promise((resolve, reject) => {
|
|||
manifest: {
|
||||
about: { socialValue: 'async' },
|
||||
backlinks: { read: 'source' },
|
||||
blobs: { get: 'source' },
|
||||
blobs: { get: 'source', want: 'async' },
|
||||
createUserStream: 'source',
|
||||
createHistoryStream: 'source',
|
||||
get: 'sync',
|
||||
messagesByType: 'source',
|
||||
publish: 'async',
|
||||
|
|
Loading…
Reference in New Issue