graphs website added
This commit is contained in:
@@ -99,8 +99,21 @@ struct ColumnOutput {
|
||||
data_type: String,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
/// Starts the analytics web UI as a detached task on the current Tokio runtime.
|
||||
///
|
||||
/// The web UI still uses the existing gRPC endpoints for now. Keeping startup
|
||||
/// here limits the server integration to a single call until the application
|
||||
/// is switched to the in-process analytics runtime.
|
||||
pub fn spawn() -> tokio::task::JoinHandle<()> {
|
||||
tokio::spawn(async {
|
||||
if let Err(error) = serve().await {
|
||||
eprintln!("Analytics graphs stopped: {error}");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Serves the analytics web UI until the task is cancelled or the listener fails.
|
||||
pub async fn serve() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
let grpc_endpoint =
|
||||
env::var("ANALYTICS_GRPC_ENDPOINT").unwrap_or_else(|_| "http://[::1]:50051".into());
|
||||
let listen_address = env::var("LISTEN_ADDRESS")
|
||||
Reference in New Issue
Block a user