From 7fbdf6746018e51359d2a974ccc1a0d8d8121f3d Mon Sep 17 00:00:00 2001 From: Shivam Kapoor <4599890+iamsmkr@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:54:35 +0000 Subject: [PATCH] more changes from #1844 --- raphtory-graphql/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/raphtory-graphql/src/main.rs b/raphtory-graphql/src/main.rs index e225d37bd..f87c4081b 100644 --- a/raphtory-graphql/src/main.rs +++ b/raphtory-graphql/src/main.rs @@ -1,4 +1,4 @@ -use raphtory_graphql::{config::app_config::AppConfigBuilder, GraphServer}; +use raphtory_graphql::{config::app_config::AppConfigBuilder, server::DEFAULT_PORT, GraphServer}; use std::{ env, path::{Path, PathBuf}, @@ -9,6 +9,7 @@ use tokio::io::Result as IoResult; async fn main() -> IoResult<()> { let default_path = Path::new("/tmp/graphs"); + let port: u16 = env::var("PORT").map(|port| port.parse().unwrap()).unwrap_or(DEFAULT_PORT); let work_dir = env::var("GRAPH_DIRECTORY").unwrap_or(default_path.display().to_string()); let work_dir = PathBuf::from(&work_dir); @@ -17,13 +18,13 @@ async fn main() -> IoResult<()> { .with_cache_capacity(30) .with_cache_tti_seconds(900) .with_log_level("DEBUG".to_string()) - .with_tracing(true) + .with_tracing(false) .with_otlp_agent_host("http://localhost".to_string()) .with_otlp_agent_port("4317".to_string()) .with_otlp_tracing_service_name("Raphtory".to_string()) .build(), ); - GraphServer::new(work_dir, app_config, None)?.run().await?; + GraphServer::new(work_dir, app_config, None)?.run_with_port(port).await?; Ok(()) }