From 2b32675e724e0ce01d609087f9a2f99f61da0c7f Mon Sep 17 00:00:00 2001 From: Byte Date: Sat, 18 Jul 2026 20:14:56 -0400 Subject: [PATCH] feat: emit Eyes boot manifest at startup Call cja::eyes_manifest::send_boot_manifest once at boot, after the job and cron registries are constructed, so Eyes learns this app's deployed job and cron shape. The cron registry, previously built privately inside run_cron, is now built once in spawn_application_tasks: it is passed by reference to the boot manifest and then moved into run_cron (which now takes the registry as a parameter). The registry is built unconditionally so the manifest reflects the full deployed shape even when CRON is disabled for this process. This is a no-op unless EYES_ORG_ID/EYES_APP_ID are configured. Part of EYES-2459e945. Co-Authored-By: Claude Opus 4.8 --- server/src/cron.rs | 9 ++++++--- server/src/main.rs | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/server/src/cron.rs b/server/src/cron.rs index 7e11606..b056c83 100644 --- a/server/src/cron.rs +++ b/server/src/cron.rs @@ -16,7 +16,7 @@ pub const MATCHMAKER_INTERVAL_SECS: u64 = 15 * 60; /// a broken snake is pulled from matchmaking after ~90 minutes. pub const SNAKE_HEALTH_SWEEP_INTERVAL_SECS: u64 = 30 * 60; -fn cron_registry() -> CronRegistry { +pub(crate) fn cron_registry() -> CronRegistry { let mut registry = CronRegistry::new(); // Game backup discovery: runs every hour, enqueues backup jobs for games from the last 4 hours @@ -60,8 +60,11 @@ fn cron_registry() -> CronRegistry { registry } -pub(crate) async fn run_cron(app_state: AppState) -> cja::Result<()> { - Ok(Worker::new(app_state, cron_registry()) +pub(crate) async fn run_cron( + app_state: AppState, + registry: CronRegistry, +) -> cja::Result<()> { + Ok(Worker::new(app_state, registry) .run(CancellationToken::new()) .await?) } diff --git a/server/src/main.rs b/server/src/main.rs index a052cff..e36fb99 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -167,6 +167,20 @@ async fn spawn_application_tasks(app_state: AppState) -> cja::Result( + Some(env!("CARGO_PKG_VERSION")), + option_env!("VERGEN_GIT_SHA"), + Some(&cron_registry), + ); + if features.server { info!("Server Enabled"); tasks.push(NamedTask::spawn( @@ -204,7 +218,10 @@ async fn spawn_application_tasks(app_state: AppState) -> cja::Result