This commit is contained in:
Nikolay Kim 2025-03-28 08:36:40 +01:00
parent 8e1f12a32b
commit e024fe7561
2 changed files with 0 additions and 8 deletions

View file

@ -208,10 +208,8 @@ impl<F: ServerConfiguration> HandleCmdState<F> {
} }
fn update_workers(&mut self, upd: Update<F::Item>) { fn update_workers(&mut self, upd: Update<F::Item>) {
println!("======== UPDATE WORKERS ===================== {:?}", self.workers.len());
match upd { match upd {
Update::Available(worker) => { Update::Available(worker) => {
println!("======== UPDATE WORKERS: avail");
self.workers.push(worker); self.workers.push(worker);
self.workers.sort(); self.workers.sort();
if self.workers.len() == 1 { if self.workers.len() == 1 {
@ -219,7 +217,6 @@ impl<F: ServerConfiguration> HandleCmdState<F> {
} }
} }
Update::Unavailable(worker) => { Update::Unavailable(worker) => {
println!("======== UPDATE WORKERS: not-avail {:?}", self.workers.len());
if let Ok(idx) = self.workers.binary_search(&worker) { if let Ok(idx) = self.workers.binary_search(&worker) {
self.workers.remove(idx); self.workers.remove(idx);
} }

View file

@ -155,7 +155,6 @@ impl<T> Worker<T> {
if self.avail.failed() { if self.avail.failed() {
self.failed.store(true, Ordering::Release); self.failed.store(true, Ordering::Release);
} }
println!("-------- update status {:?}", self.status());
self.status() self.status()
} }
} }
@ -238,7 +237,6 @@ impl WorkerAvailability {
async fn wait_for_update(&self) { async fn wait_for_update(&self) {
poll_fn(|cx| { poll_fn(|cx| {
if self.inner.updated.load(Ordering::Acquire) { if self.inner.updated.load(Ordering::Acquire) {
println!("-------- status updated");
self.inner.updated.store(false, Ordering::Release); self.inner.updated.store(false, Ordering::Release);
Poll::Ready(()) Poll::Ready(())
} else { } else {
@ -290,16 +288,13 @@ where
let fut = poll_fn(|cx| { let fut = poll_fn(|cx| {
match svc.poll_ready(cx) { match svc.poll_ready(cx) {
Poll::Ready(Ok(())) => { Poll::Ready(Ok(())) => {
println!("-------- status updated: ready");
wrk.availability.set(true); wrk.availability.set(true);
} }
Poll::Ready(Err(err)) => { Poll::Ready(Err(err)) => {
println!("-------- status updated: failed");
wrk.availability.set(false); wrk.availability.set(false);
return Poll::Ready(Err(err)); return Poll::Ready(Err(err));
} }
Poll::Pending => { Poll::Pending => {
println!("-------- status updated: pending");
wrk.availability.set(false); wrk.availability.set(false);
return Poll::Pending; return Poll::Pending;
} }