You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
签到失败:Client error '400 Bad Request' for url 'https://as.hypergryph.com/user/oauth2/v2/grant'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
起因:
在目前的签到流程中,每次签到都会进行令牌请求,这会在短时间内造成大量的API使用
(yj: 警觉),可能会导致服务器拒绝签到(只能说已经碰到了)。此外,目前没有机制来识别并重试由于这些特定错误导致的签到失败。
感觉是时候添加缓存机制来存储cred,以及对失败签到在一定时间后重试的功能了。
方案:
签到时缓存cred: 修改签到流程,将成功签到时获取的cred缓存到数据库。签到时优先使用缓存的cred,如果cred签到失败,则重新使用token请求新的cred并缓存。
识别失败的签到: 判定特定错误导致的签到失败,例如上文的
400 Bad Request
。通过分析签到过程中收到的响应,识别错误代码或错误信息等手段实现。重试失败的签到: 识别到失败的签到尝试后,将本次失败的签到用户进行记录,创建一个
<签到重试间隔>
后执行的定时器,对这些用户进行重新签到。对此应该有签到重试间隔
和最大签到重试次数
配置预期:
降低被yj击毙的可能。步骤:
可重签失败
重新触发签到。其他考虑事项:
ToDo List:
The text was updated successfully, but these errors were encountered: