chore: 默认设置请求频率限制,用户可手动调整
This commit is contained in:
@@ -78,7 +78,7 @@ impl BiliClient {
|
||||
.initial(*limit)
|
||||
.refill(*limit)
|
||||
.max(*limit)
|
||||
.interval(Duration::from_secs(*duration))
|
||||
.interval(Duration::from_millis(*duration))
|
||||
.build()
|
||||
});
|
||||
Self { client, limiter }
|
||||
|
||||
@@ -44,7 +44,11 @@ impl Default for ConcurrentLimit {
|
||||
Self {
|
||||
video: 3,
|
||||
page: 2,
|
||||
rate_limit: None,
|
||||
// 默认的限速配置,每 250ms 允许请求 4 次
|
||||
rate_limit: Some(RateLimit {
|
||||
limit: 4,
|
||||
duration: 250,
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user