diff --git a/scripts/dist.js b/scripts/dist.js index 6988a0c2..cfdbce69 100755 --- a/scripts/dist.js +++ b/scripts/dist.js @@ -22,6 +22,8 @@ const DIST_ROOT = process.env.DIST_ROOT || '/ipns/dist.ipfs.io' const ipfs = IpfsHttpClient() +const ipfsFetchTimeout = { timeout: 5 * 60 * 1000 } + async function getCurrentVersion (distName) { const pathToCurrent = join(DIST_PATH, distName, 'current') const version = await fs.promises.readFile(pathToCurrent, 'utf8') @@ -39,7 +41,7 @@ async function fetchDistData (distName) { jsonStr = await fs.promises.readFile(dataPath, 'utf8') } else { console.log(`- Fetching dist.json for ${distName} ${version} from ${DIST_ROOT}`) - jsonStr = await concat(ipfs.cat(`${DIST_ROOT}/${distName}/${version}/dist.json`)) + jsonStr = await concat(ipfs.cat(`${DIST_ROOT}/${distName}/${version}/dist.json`, ipfsFetchTimeout)) } const data = JSON.parse(jsonStr) if (!data.dateUTC && data.date) {