📜  axios之间的node js sleep - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:13.539000             🧑  作者: Mango

代码示例1
const bluebird = require('bluebird')

async function makeRequests (lines) {
  await bluebird.map(
    lines,
    async (line) => {
      const encodedLink = encodeURI(line.link)
      const response = await axios.get(encodedLink)
      // ...your response handling code here...
    },
    { concurrency: 3 }
  )
}

makeRequests(jsonParsed)