Merge remote-tracking branch 'vladexa/monotonic-usec'

This commit is contained in:
Jason Volk
2026-03-09 07:43:55 +00:00
2 changed files with 7 additions and 4 deletions

View File

@@ -65,7 +65,7 @@ pub(crate) async fn start(server: Arc<Server>) -> Result<Arc<Services>> {
let services = Services::build(server).await?.start().await?; let services = Services::build(server).await?.start().await?;
#[cfg(all(feature = "systemd", target_os = "linux"))] #[cfg(all(feature = "systemd", target_os = "linux"))]
sd_notify::notify(true, &[sd_notify::NotifyState::Ready]) sd_notify::notify(false, &[sd_notify::NotifyState::Ready])
.expect("failed to notify systemd of ready state"); .expect("failed to notify systemd of ready state");
debug!("Started"); debug!("Started");

View File

@@ -49,13 +49,16 @@ impl Deref for Service {
fn handle_reload(&self) -> Result { fn handle_reload(&self) -> Result {
if self.server.config.config_reload_signal { if self.server.config.config_reload_signal {
#[cfg(all(feature = "systemd", target_os = "linux"))] #[cfg(all(feature = "systemd", target_os = "linux"))]
sd_notify::notify(true, &[sd_notify::NotifyState::Reloading]) sd_notify::notify(false, &[
.expect("failed to notify systemd of reloading state"); sd_notify::NotifyState::Reloading,
sd_notify::NotifyState::monotonic_usec_now().expect("failed to get monotonic time"),
])
.expect("failed to notify systemd of reloading state");
self.reload(iter::empty())?; self.reload(iter::empty())?;
#[cfg(all(feature = "systemd", target_os = "linux"))] #[cfg(all(feature = "systemd", target_os = "linux"))]
sd_notify::notify(true, &[sd_notify::NotifyState::Ready]) sd_notify::notify(false, &[sd_notify::NotifyState::Ready])
.expect("failed to notify systemd of ready state"); .expect("failed to notify systemd of ready state");
} }