我们有三个python脚本,定时给玩家发放奖励,具体流程是先请求一个记录表,那一条记录,内容是包含1000个项目的数组。
然后遍历这1000个项目,挨个根据具体情况进行插入操作。
目前有两个脚本断在进行插入操作的时候,一个断在查询操作,共性就是max retries错误:

Exceptionmsg HTTPSConnectionPool(host='api.leancloud.cn', port=443): Max retries exceeded with url: /1.1/classes/Mail?fetchWhenSave=false (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x2749f90>: Failed to establish a new connection: [Errno -2] Name or service not known',))

HTTPSConnectionPool(host='api.leancloud.cn', port=443): Max retries exceeded with url: /1.1/classes/Mail?fetchWhenSave=false (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x233b610>: Failed to establish a new connection: [Errno -2] Name or service not known',))

[ERROR] [2016-04-27 21:01:09.531617] HTTPSConnectionPool(host='api.leancloud.cn', port=443): Max retries exceeded with url: /1.1/classes/PvpSnapshot?limit=1&where=%7B%7D&order=-createdAt (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x28f61d0>: Failed to establish a new connection: [Errno -2] Name or service not known',))

~

另外我们这类脚本,中间断掉之后, 要弥补非常麻烦,要查看日志,过滤出来已经处理的,然后再处理剩下的,全部要手动操作,之前有两次你们的服务故障,都恰巧是九点钟,我们都是后来手动去弥补的,这类操作有没有更稳妥的方式?

因为以后预计大概会有10来个这样的脚本。

这是DNS解析失败,请将DNS服务器设置为 119.29.29.29或114.114.114.114

一请求立刻ConnectionError: ('Connection aborted.', error(61, 'Connection refused'))是DNS问题。

这个Max retries exceeded不是DNS问题

这是另一外问题
请使用命令 telnet api.leancloud.cn 443 来确认能否连通

现在是这个错了:

requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.leancloud.cn', port=443): Max retries exceeded with url: /1.1/classes/Mail (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x107a47950>, 'Connection to api.leancloud.cn timed out. (connect timeout=15)'))