小程序
小游戏
企业微信
微信支付
扫描小程序码分享
云托管上部署了一个 Python Docker,用 Flask 写了一个服务
Docker 内已经设置了 --timeout 0
CMD exec gunicorn --bind :80 --workers 1 --threads 8 --timeout 0 main:app
在部署的时候也没有看到什么地方有设置 timeout
超时的原因是这个 API 执行时间确实不短,我看 docker log 发现执行过程还是全程顺利完成的。就是不知道能否在调用端的 promise 等得再久些
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
楼主你好,请问这个问题得到解决了吗?
我也遇到这个问题了,在小程序端请求微信云托管部署的flask接口,尽管在小程序端(wx.cloud.callContainer)设置了足够的超时阀值("timeout": 30000)依然会报 -601008
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
你好,麻烦给下环境ID,请求代码和相关日志。
var c = new wx.cloud.Cloud({resourceEnv: 'deepmatch-m1-8g5yaasneba43970'});
await c.init();
c.callContainer({ path: '/container-algo/match', method: 'GET', success: console.log, fail:console.error,})
// 以下为错误信息
VM135 WAService.js:2 Error: cloud.callContainer:fail Error: errCode: -601008 server-side request timedout | errMsg: (callId: 1627095943014-0.8164476429904035) (trace: 20:5:43 start->20:5:49 normal poll->20:5:51 normal poll->20:5:53 normal poll->20:5:53 system error (Error: errCode: -601008 server-side request timedout | errMsg: ), abort)
at dn (VM135 WAService.js:2)
at VM135 WAService.js:2
at r (VM135 WAService.js:2)(env: Windows,mp,1.05.2107072; lib: 2.18.0)
c.callContainer({ path: '/container-algo', method: 'GET', success: console.log, fail:console.error,})
// promise 里的返回:
{data: "Hello, Welcome to CloudBase!", statusCode: 200, header: {…}, errMsg: "cloud.callContainer:ok", callID: "1627096039089-0.345514259089432"}
callID: "1627096039089-0.345514259089432"
data: "Hello, Welcome to CloudBase!"
errMsg: "cloud.callContainer:ok"
header: {X-CloudBase-Request-Id: "f43ccecfe43dba5fd52f2420c6722715", server: "gunicorn", X-CloudBase-Upstream-Type: "Tencent-CloudBaseRun", Last-Modified: "Sat, 24 Jul 2021 03:07:21 GMT", date: "Sat, 24 Jul 2021 03:07:21 GMT", …}
statusCode: 200
__proto__: Object
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
楼主你好,请问这个问题得到解决了吗?
我也遇到这个问题了,在小程序端请求微信云托管部署的flask接口,尽管在小程序端(wx.cloud.callContainer)设置了足够的超时阀值("timeout": 30000)依然会报 -601008
你好,麻烦给下环境ID,请求代码和相关日志。
请求相关代码:
var c = new wx.cloud.Cloud({resourceEnv: 'deepmatch-m1-8g5yaasneba43970'});
await c.init();
c.callContainer({ path: '/container-algo/match', method: 'GET', success: console.log, fail:console.error,})
// 以下为错误信息
VM135 WAService.js:2 Error: cloud.callContainer:fail Error: errCode: -601008 server-side request timedout | errMsg: (callId: 1627095943014-0.8164476429904035) (trace: 20:5:43 start->20:5:49 normal poll->20:5:51 normal poll->20:5:53 normal poll->20:5:53 system error (Error: errCode: -601008 server-side request timedout | errMsg: ), abort)
at dn (VM135 WAService.js:2)
at VM135 WAService.js:2
at VM135 WAService.js:2
at r (VM135 WAService.js:2)(env: Windows,mp,1.05.2107072; lib: 2.18.0)
c.callContainer({ path: '/container-algo', method: 'GET', success: console.log, fail:console.error,})
// promise 里的返回:
{data: "Hello, Welcome to CloudBase!", statusCode: 200, header: {…}, errMsg: "cloud.callContainer:ok", callID: "1627096039089-0.345514259089432"}
callID: "1627096039089-0.345514259089432"
data: "Hello, Welcome to CloudBase!"
errMsg: "cloud.callContainer:ok"
header: {X-CloudBase-Request-Id: "f43ccecfe43dba5fd52f2420c6722715", server: "gunicorn", X-CloudBase-Upstream-Type: "Tencent-CloudBaseRun", Last-Modified: "Sat, 24 Jul 2021 03:07:21 GMT", date: "Sat, 24 Jul 2021 03:07:21 GMT", …}
statusCode: 200
__proto__: Object
```
07/19 16:17:08:000
algo-008
[2021-07-19 08:17:08 +0000] [1] [INFO] Starting gunicorn 20.1.0
07/19 16:17:08:000
algo-008
[2021-07-19 08:17:08 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
07/19 16:17:08:000
algo-008
[2021-07-19 08:17:08 +0000] [1] [INFO] Using worker: gthread
07/19 16:17:08:000
algo-008
[2021-07-19 08:17:08 +0000] [8] [INFO] Booting worker with pid: 8
07/19 16:17:26:000
algo-008
[2021-07-19 08:17:26 +0000] [1] [INFO] Handling signal: term
07/19 16:17:27:000
algo-008
[2021-07-19 08:17:27 +0000] [8] [INFO] Worker exiting (pid: 8)
07/19 16:17:27:000
algo-008
[2021-07-19 08:17:27 +0000] [1] [INFO] Shutting down: Master
07/19 16:53:08:000
algo-008
[2021-07-19 08:53:08 +0000] [1] [INFO] Handling signal: term
07/19 16:53:09:000
algo-008
[2021-07-19 08:53:09 +0000] [8] [INFO] Worker exiting (pid: 8)
07/19 16:53:09:000
algo-008
共获得用户资料1000份
07/19 16:53:09:000
algo-008
共获得用户资料44份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配482份
07/19 16:53:09:000
algo-008
正在进行匹配......
07/19 16:53:09:000
algo-008
已完成匹配500位...
07/19 16:53:09:000
algo-008
已完成匹配500位...
07/19 16:53:09:000
algo-008
已完成匹配1000位...
07/19 16:53:09:000
algo-008
已完成匹配1000位...
07/19 16:53:09:000
algo-008
匹配完成!
07/19 16:53:09:000
algo-008
匹配结果导入成功!
07/19 16:53:09:000
algo-008
读取现有匹配0份
07/19 16:53:09:000
algo-008
共获得用户资料1000份
07/19 16:53:09:000
algo-008
共获得用户资料44份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配1000份
07/19 16:53:09:000
algo-008
读取现有匹配526份
07/19 16:53:09:000
algo-008
正在进行匹配......
07/19 16:53:09:000
algo-008
已完成匹配500位...
07/19 16:53:09:000
algo-008
已完成匹配500位...
07/19 16:53:09:000
algo-008
已完成匹配1000位...
07/19 16:53:09:000
algo-008
已完成匹配1000位...
07/19 16:53:09:000
algo-008
匹配完成!
07/19 16:53:09:000
algo-008
匹配结果导入成功!
07/19 16:53:09:000
algo-008
读取现有匹配0份
07/19 16:53:09:000
algo-008
[2021-07-19 08:53:09 +0000] [1] [INFO] Shutting down: Master
```