Clean up shutdown

This commit is contained in:
Dominik Werder
2023-09-13 07:28:34 +02:00
parent 6407af9574
commit 869ed8e5dd
7 changed files with 501 additions and 199 deletions

View File

@@ -321,12 +321,15 @@ impl Worker {
};
trace3!("try to send result for {:?}", item);
let fut = r.tx.make_send(Ok(item));
match fut.await {
Ok(()) => {}
Err(_e) => {
match tokio::time::timeout(Duration::from_millis(2000), fut).await {
Ok(Ok(())) => {}
Ok(Err(_e)) => {
warn!("can not deliver result");
return Err(Error::ChannelError);
}
Err(_) => {
debug!("timeout can not deliver result");
}
}
}
}