1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-23 22:51:07 +01:00

better inflight readiness check

This commit is contained in:
Nikolay Kim 2019-02-01 15:15:53 -08:00
parent 132be0baa1
commit 8cdbf49187

View File

@ -106,11 +106,12 @@ where
type Future = InFlightServiceResponse<T, Request>;
fn poll_ready(&mut self) -> Poll<(), Self::Error> {
let res = self.service.poll_ready();
if res.is_ok() && !self.count.available() {
let res = self.service.poll_ready()?;
if res.is_ready() && !self.count.available() {
log::trace!("InFlight limit exceeded");
return Ok(Async::NotReady);
}
res
Ok(res)
}
fn call(&mut self, req: Request) -> Self::Future {