xiongzhu 2 anni fa
parent
commit
2f2438a9a7
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      routes/api/index.js

+ 2 - 2
routes/api/index.js

@@ -89,7 +89,7 @@ module.exports = async function (fastify, opts) {
                                 }
                             })
                             console.log(asin + ' end')
-                            return { text, href, price, asin, data: sif.data.data }
+                            res.push({ text, href, price, asin, data: sif.data.data })
                         }
                     } catch (error) {}
                     await setTimeout(1000)
@@ -98,7 +98,7 @@ module.exports = async function (fastify, opts) {
         })
         res = await new Promise((resolve, reject) => {
             queue.start(() => {
-                resolve(queue.results.filter(item => !!item))
+                resolve()
             })
         })
         await browser.close()