Browse Source

storage-node: make newly uploaded content immediately available on host

Mokhtar Naamani 3 years ago
parent
commit
63934d480a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      storage-node/packages/colossus/paths/asset/v0/{id}.js

+ 5 - 0
storage-node/packages/colossus/paths/asset/v0/{id}.js

@@ -227,6 +227,11 @@ module.exports = function (storage, runtime, ipfsHttpGatewayUrl, anonymous) {
           // they cannot be different unless we did something stupid!
           assert(hash === dataObject.ipfs_content_id.toString())
 
+          ipfsContentIdMap.set(id, {
+            ipfs_content_id: hash,
+            local: true,
+          })
+
           // Send ok response early, no need for client to wait for relationships to be created.
           debug('Sending OK response.')
           res.status(200).send({ message: 'Asset uploaded.' })