mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-22 05:58:21 -05:00
Apply suggestions from code review
This commit is contained in:
parent
3c1aaf63f8
commit
0132a63e6f
@ -48,7 +48,7 @@ pub struct AggregatorConfig {
|
|||||||
pub random_delay: bool,
|
pub random_delay: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Configuration options for the rate limter middleware.
|
/// Configuration options for the rate limiter middleware.
|
||||||
///
|
///
|
||||||
/// # Fields
|
/// # Fields
|
||||||
///
|
///
|
||||||
|
@ -71,8 +71,8 @@ pub fn run(listener: TcpListener, config: Config) -> std::io::Result<Server> {
|
|||||||
.wrap(cors)
|
.wrap(cors)
|
||||||
.wrap(Governor::new(
|
.wrap(Governor::new(
|
||||||
&GovernorConfigBuilder::default()
|
&GovernorConfigBuilder::default()
|
||||||
.per_second(config.rate_limter.time_limit as u64)
|
.per_second(config.rate_limiter.time_limit as u64)
|
||||||
.burst_size(config.rate_limter.number_of_requests as u32)
|
.burst_size(config.rate_limiter.number_of_requests as u32)
|
||||||
.finish()
|
.finish()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
))
|
))
|
||||||
|
Loading…
Reference in New Issue
Block a user