Skip to content

Commit

Permalink
chore: 默认设置请求频率限制,用户可手动调整
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoaer committed Jan 13, 2025
1 parent 265fe63 commit 7dc049f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/bili_sync/src/bilibili/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
6 changes: 5 additions & 1 deletion crates/bili_sync/src/config/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
}
}
}
Expand Down

0 comments on commit 7dc049f

Please sign in to comment.