云数据库接口调用警告调用时间超过3秒怎么解决?
代码很简单,没有复杂的查询,但是仍旧报调用时间超过3秒的告警。运行环境是云函数。
Database operation database.queryDocument is longer than 3s. Please check query performance and your network environment.
async function getHelpMark(result) { console.log( "qzid:" + result.qzid) return new Promise( function (resolve, reject) { let db = cloud.database() let t_quizzes = db.collection( 'quizzes' ) t_quizzes.doc(result.qzid) .field({ helpMark: true }) .get().then(res => { console.log(res) resolve({ qzid: result.qzid, helpMark: res.data.helpMark }) }) }) } |
看不出有什么影响效率的地方,请高手指点迷津,谢谢!