···11mod consumer;
22pub mod error;
33mod firehose_cache;
44+mod healthcheck;
45mod identity;
56mod record;
67mod server;
7889pub use consumer::consume;
910pub use firehose_cache::firehose_cache;
1111+pub use healthcheck::healthcheck;
1012pub use identity::Identity;
1113pub use record::{CachedRecord, ErrorResponseObject, Repo};
1214pub use server::serve;
+14-1
slingshot/src/main.rs
···11// use foyer::HybridCache;
22// use foyer::{Engine, DirectFsDeviceOptions, HybridCacheBuilder};
33use metrics_exporter_prometheus::PrometheusBuilder;
44-use slingshot::{Identity, Repo, consume, error::MainTaskError, firehose_cache, serve};
44+use slingshot::{
55+ Identity, Repo, consume, error::MainTaskError, firehose_cache, healthcheck, serve,
66+};
57use std::path::PathBuf;
6879use clap::Parser;
···4446 /// recommended in production, but mind the file permissions.
4547 #[arg(long)]
4648 certs: Option<PathBuf>,
4949+ /// an web address to send healtcheck pings to every ~51s or so
5050+ #[arg(long)]
5151+ healthcheck: Option<String>,
4752}
48534954#[tokio::main]
···126131 .await?;
127132 Ok(())
128133 });
134134+135135+ if let Some(hc) = args.healthcheck {
136136+ let healthcheck_shutdown = shutdown.clone();
137137+ tasks.spawn(async move {
138138+ healthcheck(hc, healthcheck_shutdown).await?;
139139+ Ok(())
140140+ });
141141+ }
129142130143 tokio::select! {
131144 _ = shutdown.cancelled() => log::warn!("shutdown requested"),