diff options
| author | Christine Dodrill <me@christine.website> | 2021-03-07 14:38:10 -0500 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2021-03-07 14:38:10 -0500 |
| commit | dd445722fe113f9e8ff77808494f7c028dc65e91 (patch) | |
| tree | 004a3f9dd9e1289fe33de3cf78fe62e94e1c542e /src | |
| parent | c51ffae976df83b97554cff753ec215a1e0f35c7 (diff) | |
| download | xesite-dd445722fe113f9e8ff77808494f7c028dc65e91.tar.xz xesite-dd445722fe113f9e8ff77808494f7c028dc65e91.zip | |
fix production
Signed-off-by: Christine Dodrill <me@christine.website>
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/main.rs b/src/main.rs index e39c822..7ebfbdf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -207,29 +207,30 @@ async fn main() -> Result<()> { .with(warp::log(APPLICATION_NAME)) .recover(handlers::rejection); - #[cfg(linux)] - { - match sdnotify::SdNotify::from_env() { - Ok(ref mut n) => { - // shitty heuristic for detecting if we're running in prod - tokio::spawn(async { - if let Err(why) = app::poke::the_cloud().await { - error!("Unable to poke the cloud: {}", why); - } - }); - - n.notify_ready().map_err(|why| { - error!("can't signal readiness to systemd: {}", why); - why - })?; - n.set_status(format!("hosting {} posts", state.clone().everything.len())) - .map_err(|why| { - error!("can't signal status to systemd: {}", why); + #[cfg(target_os = "linux")] + { + match sdnotify::SdNotify::from_env() { + Ok(ref mut n) => { + // shitty heuristic for detecting if we're running in prod + tokio::spawn(async { + if let Err(why) = app::poke::the_cloud().await { + error!("Unable to poke the cloud: {}", why); + } + }); + + n.notify_ready().map_err(|why| { + error!("can't signal readiness to systemd: {}", why); why })?; + n.set_status(format!("hosting {} posts", state.clone().everything.len())) + .map_err(|why| { + error!("can't signal status to systemd: {}", why); + why + })?; + } + Err(why) => error!("not running under systemd with Type=notify: {}", why), } - Err(why) => error!("not running under systemd with Type=notify: {}", why), - }} + } warp::serve(site) .run(( |
