Merge '6649f4ca51a535632b3986c48e6f42ee0224d429'
This commit is contained in:
@@ -128,6 +128,11 @@ impl Probe {
|
||||
sausage_plugin::listen("/state/control", std::rc::Rc::new(Control)).await?;
|
||||
Ok(sausage_plugin::pid())
|
||||
}
|
||||
/// Keep an idle listener and ownership lock until opt-in drain ends this process.
|
||||
async fn drain_service(&self) -> Result<String> {
|
||||
lock("/drain-owner").await?.keep();
|
||||
self.service().await
|
||||
}
|
||||
/// Add two numbers.
|
||||
///
|
||||
/// The result is their sum.
|
||||
@@ -238,6 +243,7 @@ impl Probe {
|
||||
#[sausage_plugin::on_stop]
|
||||
async fn stop(&self) {
|
||||
std::fs::write("/stopped", b"yes").unwrap();
|
||||
std::fs::write(format!("/stopped-{}", sausage_plugin::pid()), b"yes").unwrap();
|
||||
Ctx::default().notify("stopped", json!({})).unwrap();
|
||||
assert!(call("other.no", json!({})).await.is_err());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user