···1mod consumer;
2pub mod error;
3mod firehose_cache;
04mod identity;
5mod record;
6mod server;
78pub use consumer::consume;
9pub use firehose_cache::firehose_cache;
010pub use identity::Identity;
11pub use record::{CachedRecord, ErrorResponseObject, Repo};
12pub use server::serve;
···1mod consumer;
2pub mod error;
3mod firehose_cache;
4+mod healthcheck;
5mod identity;
6mod record;
7mod server;
89pub use consumer::consume;
10pub use firehose_cache::firehose_cache;
11+pub use healthcheck::healthcheck;
12pub use identity::Identity;
13pub use record::{CachedRecord, ErrorResponseObject, Repo};
14pub use server::serve;
+14-1
slingshot/src/main.rs
···1// use foyer::HybridCache;
2// use foyer::{Engine, DirectFsDeviceOptions, HybridCacheBuilder};
3use metrics_exporter_prometheus::PrometheusBuilder;
4-use slingshot::{Identity, Repo, consume, error::MainTaskError, firehose_cache, serve};
005use std::path::PathBuf;
67use clap::Parser;
···44 /// recommended in production, but mind the file permissions.
45 #[arg(long)]
46 certs: Option<PathBuf>,
00047}
4849#[tokio::main]
···126 .await?;
127 Ok(())
128 });
00000000129130 tokio::select! {
131 _ = shutdown.cancelled() => log::warn!("shutdown requested"),
···1// use foyer::HybridCache;
2// use foyer::{Engine, DirectFsDeviceOptions, HybridCacheBuilder};
3use metrics_exporter_prometheus::PrometheusBuilder;
4+use slingshot::{
5+ Identity, Repo, consume, error::MainTaskError, firehose_cache, healthcheck, serve,
6+};
7use std::path::PathBuf;
89use clap::Parser;
···46 /// recommended in production, but mind the file permissions.
47 #[arg(long)]
48 certs: Option<PathBuf>,
49+ /// an web address to send healtcheck pings to every ~51s or so
50+ #[arg(long)]
51+ healthcheck: Option<String>,
52}
5354#[tokio::main]
···131 .await?;
132 Ok(())
133 });
134+135+ if let Some(hc) = args.healthcheck {
136+ let healthcheck_shutdown = shutdown.clone();
137+ tasks.spawn(async move {
138+ healthcheck(hc, healthcheck_shutdown).await?;
139+ Ok(())
140+ });
141+ }
142143 tokio::select! {
144 _ = shutdown.cancelled() => log::warn!("shutdown requested"),