Relax rate-limit

This commit is contained in:
Benji Grant 2023-06-09 23:20:51 +10:00
parent 21fc28987b
commit b6f64fa23b

View file

@ -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 {