mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-09-07 00:17:24 +08:00
chore: 默认设置请求频率限制,用户可手动调整
This commit is contained in:
@@ -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 }
|
||||||
|
|||||||
@@ -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,
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user