如题
函数的超时时间设定为20秒。
日志中所有报错的运行时间大约为20ms。
错误信息:
{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Error: document.update:fail -501001 resource system error. ETIMEDOUT\n at toSDKError (/var/user/node_modules/wx-server-sdk/index.js:8094:19)\n at Object.returnAsFinalCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:8065:12)\n at /var/user/node_modules/wx-server-sdk/index.js:1347:32\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at runNextTicks (node:internal/process/task_queues:65:3)\n at listOnTimeout (node:internal/timers:526:9)\n at processTimers (node:internal/timers:500:7)","statusCode":430}
花了好多时间,终于搞清楚了。
原因是其中一个函数没有用await
async someFunc(){
await cloud.collection('users')...
}
加上await 就没有超时的问题了。
好一通找