Fix shutdown signalling on startup.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -104,10 +104,7 @@ impl Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn signal(&self, sig: &'static str) -> Result {
|
pub fn signal(&self, sig: &'static str) -> Result {
|
||||||
if let Err(e) = self.signal.send(sig) {
|
self.signal.send(sig).ok();
|
||||||
return Err!("Failed to send signal: {e}");
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,10 +137,10 @@ impl Service {
|
|||||||
statuses: &mut CurTransactionStatus,
|
statuses: &mut CurTransactionStatus,
|
||||||
) {
|
) {
|
||||||
match response {
|
match response {
|
||||||
|
| Err((dest, e)) => Self::handle_response_err(dest, statuses, &e),
|
||||||
| Ok(dest) =>
|
| Ok(dest) =>
|
||||||
self.handle_response_ok(&dest, futures, statuses)
|
self.handle_response_ok(&dest, futures, statuses)
|
||||||
.await,
|
.await,
|
||||||
| Err((dest, e)) => Self::handle_response_err(dest, statuses, &e),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,8 +149,10 @@ impl Service {
|
|||||||
statuses.entry(dest).and_modify(|e| {
|
statuses.entry(dest).and_modify(|e| {
|
||||||
*e = match e {
|
*e = match e {
|
||||||
| TransactionStatus::Running => TransactionStatus::Failed(1, Instant::now()),
|
| TransactionStatus::Running => TransactionStatus::Failed(1, Instant::now()),
|
||||||
|
|
||||||
| &mut TransactionStatus::Retrying(ref n) =>
|
| &mut TransactionStatus::Retrying(ref n) =>
|
||||||
TransactionStatus::Failed(n.saturating_add(1), Instant::now()),
|
TransactionStatus::Failed(n.saturating_add(1), Instant::now()),
|
||||||
|
|
||||||
| TransactionStatus::Failed(..) => {
|
| TransactionStatus::Failed(..) => {
|
||||||
panic!("Request that was not even running failed?!")
|
panic!("Request that was not even running failed?!")
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user