Relax rate-limit
This commit is contained in:
parent
21fc28987b
commit
b6f64fa23b
|
|
@ -61,9 +61,14 @@ async fn main() {
|
|||
);
|
||||
|
||||
// Rate limiting configuration (using tower_governor)
|
||||
// From the docs: Allows bursts with up to eight requests and replenishes
|
||||
// From the docs: Allows bursts with up to 20 requests and replenishes
|
||||
// one element after 500ms, based on peer IP.
|
||||
let governor_config = Box::new(GovernorConfigBuilder::default().finish().unwrap());
|
||||
let governor_config = Box::new(
|
||||
GovernorConfigBuilder::default()
|
||||
.burst_size(20)
|
||||
.finish()
|
||||
.unwrap(),
|
||||
);
|
||||
let rate_limit = ServiceBuilder::new()
|
||||
// Handle errors from governor and convert into HTTP responses
|
||||
.layer(HandleErrorLayer::new(|e: BoxError| async move {
|
||||
|
|
|
|||
Loading…
Reference in a new issue