소스 검색

storage-node: allow 4s to stat local file before considering it not available locally

Mokhtar Naamani 3 년 전
부모
커밋
198d45a7f4
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      storage-node/packages/colossus/paths/asset/v0/{id}.js

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

@@ -75,7 +75,7 @@ module.exports = function (storage, runtime, ipfsHttpGatewayUrl, anonymous) {
 
     // Not yet processed by sync run, check if we have it locally
     try {
-      const stat = await storage.ipfsStat(ipfs_content_id, 250)
+      const stat = await storage.ipfsStat(ipfs_content_id, 4000)
 
       if (stat.local) {
         ipfsContentIdMap.set(content_id, {
@@ -87,8 +87,8 @@ module.exports = function (storage, runtime, ipfsHttpGatewayUrl, anonymous) {
         return proxy(req, res, next)
       }
     } catch (_err) {
-      // timeout or some other error trying to stat
-      debug('Failed to stat', ipfs_content_id)
+      // timeout trying to stat which most likely means we do not have it
+      // debug('Failed to stat', ipfs_content_id)
     }
 
     // Valid content but no certainty that the node has it locally yet.