2020-01-16 18:11 云函数定时任务报了一波错误,具体报错详情见下面错误信息
更新备注:的确使用了 promise.all + reduce 方法取出的全量数据,但是目前库里只有3条数据,还是会偶发性的报 -501004;
18:11 分 集中报了一波错,大概 14 条:
{
"message": "errCode: -501004 exceed concurrent request limit | errMsg: [LimitExceeded.NoValidConnection] Connection num overrun. Please improve specifications, but if the problem cannot be solved, contact us.; ",
"name": "",
"stack": "Error: errCode: -501004 exceed concurrent request limit | errMsg: [LimitExceeded.NoValidConnection] Connection num overrun. Please improve specifications, but if the problem cannot be solved, contact us.; \n at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6052:16)\n at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1378:23)\n at Promise (/var/user/node_modules/wx-server-sdk/index.js:1508:33)\n at \n at process._tickCallback (internal/process/next_tick.js:188:7)",
"userInfo": {
"appId": "wx4bfbc8e64eff19eb"
}
}
然后登陆云函数后台查看日志发现,下面提示
日志内容 Request ID: 4c830adf-14b7-4fff-b2cd-3487add8034f
执行时间: 9372.41ms内存使用: 37.93 MB
返回结果 null
日志
START RequestId: 4c830adf-14b7-4fff-b2cd-3487add8034f
Event RequestId: 4c830adf-14b7-4fff-b2cd-3487add8034f
2020-01-16T10:11:53.154Z Database operation database.queryDocument is longer than 3s. Please check query performance and your network environment.
END RequestId: 4c830adf-14b7-4fff-b2cd-3487add8034f
Report RequestId: 4c830adf-14b7-4fff-b2cd-3487add8034f Duration:9372ms Memory:256MB MaxMemoryUsed:37.929688MB
大概从 17: 57 开始,执行时间由 70ms 升到 3、4 秒,中间甚至十几秒,到 18: 11 分后定时任务停止。
4 回复