move cmd off of grpc

This commit is contained in:
2025-12-30 14:19:41 -05:00
parent 29f7f6d83b
commit 6980b7f6aa
26 changed files with 452 additions and 389 deletions

View File

@@ -1,14 +1,8 @@
mod command;
mod grpc;
mod http;
mod panels;
mod serialization;
mod telemetry;
mod uuid;
pub mod core {
tonic::include_proto!("core");
}
use crate::command::service::CommandManagementService;
use crate::panels::PanelService;
@@ -53,14 +47,11 @@ pub async fn setup() -> anyhow::Result<()> {
let cmd = Arc::new(CommandManagementService::new());
let grpc_server = grpc::setup(cancellation_token.clone(), cmd.clone())?;
let panel_service = PanelService::new(sqlite.clone());
let result = http::setup(cancellation_token.clone(), tlm.clone(), panel_service, cmd).await;
cancellation_token.cancel();
result?; // result is dropped
grpc_server.await?; //grpc server is dropped
drop(cancellation_token); // All cancellation tokens are now dropped
sqlite.close().await;