diff options
| author | Your Name <you@example.com> | 2026-05-26 18:01:30 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-26 18:01:30 +0530 |
| commit | e435f7d7b4ad4e4b1d3c21c35df5f41ffd642376 (patch) | |
| tree | ccb0587d8aff2d0513f2cef359349b6e0b1b947f /src/config.rs | |
| parent | 8816a192c95cf539b65975469a2d61aed46f0414 (diff) | |
Add HTTP health endpoint on /health and /api/mirror-health
- New axum-based health server on port 7335 (configurable via health_port)
- Reports status, uptime, cycle_count, last_cycle_ok as JSON
- Status is 'ok' on startup and after successful cycles, 'degraded' after failures
- Config: storage.health_port defaults to 7335
- Spawned alongside daemon loop, independent of mirror cycles
Diffstat (limited to 'src/config.rs')
| -rw-r--r-- | src/config.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index ceff44d..037deb2 100644 --- a/src/config.rs +++ b/src/config.rs | |||
| @@ -33,6 +33,12 @@ pub struct StorageConfig { | |||
| 33 | pub mirror_dir: PathBuf, | 33 | pub mirror_dir: PathBuf, |
| 34 | #[serde(default = "default_database")] | 34 | #[serde(default = "default_database")] |
| 35 | pub database: PathBuf, | 35 | pub database: PathBuf, |
| 36 | #[serde(default = "default_health_port")] | ||
| 37 | pub health_port: u16, | ||
| 38 | } | ||
| 39 | |||
| 40 | fn default_health_port() -> u16 { | ||
| 41 | 7335 | ||
| 36 | } | 42 | } |
| 37 | 43 | ||
| 38 | fn default_mirror_dir() -> PathBuf { | 44 | fn default_mirror_dir() -> PathBuf { |