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