chore: 默认设置请求频率限制,用户可手动调整

This commit is contained in:
amtoaer
2025-01-14 00:08:38 +08:00
parent 265fe630dd
commit 7dc049ffe5
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ impl BiliClient {
.initial(*limit) .initial(*limit)
.refill(*limit) .refill(*limit)
.max(*limit) .max(*limit)
.interval(Duration::from_secs(*duration)) .interval(Duration::from_millis(*duration))
.build() .build()
}); });
Self { client, limiter } Self { client, limiter }
+5 -1
View File
@@ -44,7 +44,11 @@ impl Default for ConcurrentLimit {
Self { Self {
video: 3, video: 3,
page: 2, page: 2,
rate_limit: None, // 默认的限速配置,每 250ms 允许请求 4 次
rate_limit: Some(RateLimit {
limit: 4,
duration: 250,
}),
} }
} }
} }