Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Mar 23, 2024
1 parent 9489fb3 commit f9f5d73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 0 additions & 1 deletion ntex-server/src/wrk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ impl<T> PartialEq for Worker<T> {
}

#[derive(Debug)]
#[must_use = "Future do nothing unless polled"]
/// Stop worker process
///
/// Stop future resolves when worker completes processing
Expand Down
16 changes: 13 additions & 3 deletions ntex/src/server/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,27 @@ impl Service<ServerMessage> for StreamServiceImpl {

fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
let mut ready = self.conns.available(cx);
for (idx, tag, pool, _) in self.tokens.values() {
match self.services[*idx].poll_ready(cx) {
for (idx, svc) in self.services.iter().enumerate() {
match svc.poll_ready(cx) {
Poll::Pending => ready = false,

Check warning on line 149 in ntex/src/server/service.rs

View check run for this annotation

Codecov / codecov/patch

ntex/src/server/service.rs#L149

Added line #L149 was not covered by tests
Poll::Ready(Ok(())) => (),
Poll::Ready(Err(_)) => {
log::error!("{}: Service readiness has failed", tag);
for (idx_, tag, _, _) in self.tokens.values() {
if idx == *idx_ {
log::error!("{}: Service readiness has failed", tag);
break;
}

Check warning on line 156 in ntex/src/server/service.rs

View check run for this annotation

Codecov / codecov/patch

ntex/src/server/service.rs#L152-L156

Added lines #L152 - L156 were not covered by tests
}
return Poll::Ready(Err(()));

Check warning on line 158 in ntex/src/server/service.rs

View check run for this annotation

Codecov / codecov/patch

ntex/src/server/service.rs#L158

Added line #L158 was not covered by tests
}
}
}

// check memory pools
for (_, _, pool, _) in self.tokens.values() {
ready = pool.poll_ready(cx).is_ready() && ready;
}

if ready {
Poll::Ready(Ok(()))
} else {
Expand Down

0 comments on commit f9f5d73

Please sign in to comment.