edenapi_server: use LoadMiddleware

Summary: Use `LoadMiddleware` to track the number of outstanding requests in the server.

Reviewed By: DurhamG

Differential Revision: D23298415

fbshipit-source-id: bdcdb0f657d8deac593d356c87ac0d8d3f39e322
This commit is contained in:
Arun Kulshreshtha 2020-09-03 11:56:33 -07:00 committed by Facebook GitHub Bot
parent 7144363d2c
commit 96a6a3fcfb

View File

@ -35,7 +35,10 @@ use cmdlib::{
use fbinit::FacebookInit;
use gotham_ext::{
handler::MononokeHttpHandler,
middleware::{ClientIdentityMiddleware, ServerIdentityMiddleware, TlsSessionDataMiddleware},
middleware::{
ClientIdentityMiddleware, LoadMiddleware, PostRequestMiddleware, ServerIdentityMiddleware,
TlsSessionDataMiddleware,
},
socket_data::TlsSocketData,
};
use mononoke_api::Mononoke;
@ -153,7 +156,9 @@ async fn start(
.add(ServerIdentityMiddleware::new(HeaderValue::from_static(
"edenapi_server",
)))
.add(PostRequestMiddleware::default())
.add(RequestContextMiddleware::new(fb, logger.clone()))
.add(LoadMiddleware::new())
.build(router);
// Set up socket and TLS acceptor that this server will listen on.