From a2646a828febbdac798a206655a15eae7e463bca Mon Sep 17 00:00:00 2001 From: soryu Date: Mon, 9 Feb 2026 02:35:36 +0000 Subject: Add directive init --- makima/src/server/mod.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'makima/src/server') diff --git a/makima/src/server/mod.rs b/makima/src/server/mod.rs index 7a1391b..4cb4296 100644 --- a/makima/src/server/mod.rs +++ b/makima/src/server/mod.rs @@ -481,6 +481,25 @@ pub async fn run_server(state: SharedState, addr: &str) -> anyhow::Result<()> { "Retry orchestrator started (interval: {}s)", RETRY_ORCHESTRATOR_INTERVAL_SECS ); + + // Spawn directive orchestrator - automates directive lifecycle + let directive_pool = pool.clone(); + let directive_state = state.clone(); + tokio::spawn(async move { + let mut orch = crate::orchestration::directive::DirectiveOrchestrator::new( + directive_pool, + directive_state, + ); + let mut interval = tokio::time::interval(std::time::Duration::from_secs(15)); + loop { + interval.tick().await; + if let Err(e) = orch.tick().await { + tracing::warn!(error = %e, "Directive orchestrator tick failed"); + } + } + }); + + tracing::info!("Directive orchestrator started (interval: 15s)"); } let app = make_router(state); -- cgit v1.2.3