restore signal state after channel failures
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
c1c084dda1
commit
a309ef55c9
1 changed files with 6 additions and 1 deletions
|
@ -76,7 +76,10 @@ impl Server {
|
||||||
return Err(Error::Err("Shutdown already in progress".into()));
|
return Err(Error::Err("Shutdown already in progress".into()));
|
||||||
}
|
}
|
||||||
|
|
||||||
self.signal("SIGINT")
|
self.signal("SIGINT").inspect_err(|_| {
|
||||||
|
self.stopping.store(false, Ordering::Release);
|
||||||
|
self.reloading.store(false, Ordering::Release);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn restart(&self) -> Result<()> {
|
pub fn restart(&self) -> Result<()> {
|
||||||
|
@ -85,6 +88,7 @@ impl Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.shutdown()
|
self.shutdown()
|
||||||
|
.inspect_err(|_| self.restarting.store(false, Ordering::Release))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn shutdown(&self) -> Result<()> {
|
pub fn shutdown(&self) -> Result<()> {
|
||||||
|
@ -93,6 +97,7 @@ impl Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.signal("SIGTERM")
|
self.signal("SIGTERM")
|
||||||
|
.inspect_err(|_| self.stopping.store(false, Ordering::Release))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn signal(&self, sig: &'static str) -> Result<()> {
|
pub fn signal(&self, sig: &'static str) -> Result<()> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue