Skip to content

Commit 3fc714e

Browse files
committed
Fix: Http Server
1 parent b31c022 commit 3fc714e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ async fn main() -> anyhow::Result<()> {
6262
// Retrieve configuration values from the environment.
6363
let bucket = env::var("S3_BUCKET_NAME")
6464
.context("S3_BUCKET_NAME environment variable not set")?;
65-
let http_port = env::var("HTTP_PORT").unwrap_or_else(|_| "8080".to_string());
65+
// Prefer using the PORT environment variable for HTTP (default to 8080 if not set)
66+
let http_port = env::var("PORT").unwrap_or_else(|_| "8080".to_string());
6667
let pgwire_port = env::var("PGWIRE_PORT").unwrap_or_else(|_| "5432".to_string());
6768
let s3_uri = format!("s3://{}/delta_table", bucket);
6869

@@ -96,8 +97,7 @@ async fn main() -> anyhow::Result<()> {
9697
.await
9798
.context("Failed to compact project 'events'")?;
9899

99-
// Initialize the persistent queue using an absolute path matching the Dockerfile.
100-
// Note: PersistentQueue::new returns a Result, so we use `?` here.
100+
// Initialize the persistent queue using the absolute path (as set in the Dockerfile).
101101
let queue = Arc::new(PersistentQueue::new("/app/queue_db")?);
102102

103103
// Initialize the ingestion status store.
@@ -207,6 +207,7 @@ async fn main() -> anyhow::Result<()> {
207207
});
208208

209209
// Start the HTTP server with Logger middleware, health, and metrics endpoints.
210+
// Bind to the port provided by the PORT environment variable.
210211
let http_addr = format!("0.0.0.0:{}", http_port);
211212
let http_server = HttpServer::new(move || {
212213
App::new()

0 commit comments

Comments
 (0)