大佬教程收集整理的这篇文章主要介绍了node.js – BigQuery读取ECONNRESET,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我们的错误日志:
Error: read ECONNRESET at exports._errnoException (util.js:1026:11) at TLSWrap.onread (net.js:569:26)
这是我同事的代码.
const bigQuery = require('@google-cloud/bigquery'); const admin = require('firebase-admin'); const database = admin.database(); exports.@R_618_9531@eAllPlaceStatistics = (request,responsE) => { const secret = request.querY['secret']; if (secret !== 'secret') { return response.json({message: 'request Failed!'}); } const big = bigQuery(); return big.query({ query: [ 'SELECT place.id,COUNT(DISTinCT beacon.id) as beacons,COUNT(DISTinCT promotion.id) as promotions,placeUserS.Users as users','FROM `omega.sw_places` as place','LEFT JOIN `omega.sw_promotions` as promotion ON promotion.place_id = place.id','LEFT JOIN `omega.sw_beacons` as beacon ON beacon.place_id = place.id','LEFT JOIN `omega.view_users_per_place` as placeUsers ON placeUsers.id = place.id','GROUP BY place.id,placeUserS.Users' ].join(' '),params: [] }).then((data) => { const rows = data[0]; let result = {}; for (let index = 0; index < rows.length; index++) { const item = rows[index]; result[item.id] = { beacons: item.beacons,promotions: item.promotions }; } return database.ref('statistics/general').set(result); }).then(() => { return response.json({message: 'request succeeded!'}); }).catch((error) => { console.log('An error has happened to the big_query.js'); console.log(JSON.Stringify(error)); return response.json({message: 'request Failed!'}); }); };
出了什么问题?
以上是大佬教程为你收集整理的node.js – BigQuery读取ECONNRESET全部内容,希望文章能够帮你解决node.js – BigQuery读取ECONNRESET所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。