Skip to content

Commit

Permalink
fix(ci) bump ipfs.cat timeout to 5m
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Dec 15, 2021
1 parent 1d3fca0 commit 8cf1381
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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) {
Expand Down

0 comments on commit 8cf1381

Please sign in to comment.