Skip to content

Kimi K2.5 给所有通过request获取数据的接口加上频率限制#89

Open
w60031872 wants to merge 5 commits intoSnowfall-in-June:mainfrom
w60031872:main
Open

Kimi K2.5 给所有通过request获取数据的接口加上频率限制#89
w60031872 wants to merge 5 commits intoSnowfall-in-June:mainfrom
w60031872:main

Conversation

@w60031872
Copy link

功能要求
所有通过request获取数据的接口加上频率限制,同一个域名每分钟默认控制30次请求,次数要求可以通过方法设置,尽可能少改代码,尽可能代码实现优雅。
步骤:
在 SunRequests 类中添加域名频率限制功能
添加设置域名频率限制的方法
导出新的方法供外部使用
验证代码正缺性

优点
代码改动小 只新增了DomainRateLimiter类,对原有代码影响小。
配置灵活,支持链式调用,

整体满意度为5分

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant