Closed Yunxi-awa closed 8 months ago
这个我有遇到过,大概率是禁漫的Could not connect to mysql! Please check your database settings!
这个我有遇到过,大概率是禁漫的Could not connect to mysql! Please check your database settings!
大佬知道有曲线救国的方法吗
这个我有遇到过,大概率是禁漫的Could not connect to mysql! Please check your database settings!
大佬知道有曲线救国的方法吗
遇到这个就说明禁漫服务器内部异常,这次请求失败了。 可以优化一下,当遇到这种情况时,走重试机制。
下个版本会把这种情况加入重试处理
v2.5.1: 已增加对json格式返回值检查。 如果发现返回值应该是json格式但不是,则会强制抛出异常,该异常会被请求重试机制catch到,从而走请求重试的逻辑。 为了减少性能开销,只对少数情况做了简单检查。外界可以扩展此检查,参考如下代码:
from jmcomic import *
# 自定义Client
class MyApiClient(JmApiClient):
def raise_if_resp_should_retry(self, resp):
"""
在这个方法对resp响应对象进行检查,
如果觉得不满意想重试,可以抛出异常
如果满意,返回resp
"""
return super().raise_if_resp_should_retry(resp)
JmModuleConfig.register_client(MyApiClient)
create_option(...)
以下是报错信息,复现起来可能有点困难,压测了6个小时发现的Bug(另外怀疑Html端也有相似问题,但我这边网络很迷,没法测试 可以在解析JSON时判断行是否有效,建议在option设置一个选项能控制遇到此类错误是直接抛异常还是继续执行