From 0b3dda0d8f7fced3325fb9a6df1e3a4b3e6cab38 Mon Sep 17 00:00:00 2001 From: Thorrester Date: Tue, 24 Sep 2024 17:12:40 -0400 Subject: [PATCH] add rabbitmq test --- .github/workflows/test-lints.yml | 2 +- src/main.rs | 4 +++- src/rabbitmq/startup.rs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-lints.yml b/.github/workflows/test-lints.yml index 46e788d..7e0463f 100644 --- a/.github/workflows/test-lints.yml +++ b/.github/workflows/test-lints.yml @@ -56,7 +56,7 @@ jobs: if: always() run: docker compose -f "docker-compose.yml" down - test-kafka: + test-kafka-rabbitmq: needs: test-os name: test kafka diff --git a/src/main.rs b/src/main.rs index d23b112..88196d5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,7 +49,9 @@ async fn start_main_server() -> Result<(), anyhow::Error> { startup_kafka(pool.clone()).await?; } - startup_rabbitmq(pool.clone()).await?; + if std::env::var("RABBITMQ_ADDR").is_ok() { + startup_rabbitmq(pool.clone()).await?; + } // run drift background task let num_scheduler_workers = std::env::var("NUM_SCOUTER_SCHEDULER_WORKERS") diff --git a/src/rabbitmq/startup.rs b/src/rabbitmq/startup.rs index cfa95fe..d1cb715 100644 --- a/src/rabbitmq/startup.rs +++ b/src/rabbitmq/startup.rs @@ -8,7 +8,7 @@ pub async fn startup_rabbitmq(pool: Pool) -> Result<(), anyhow::Error> info!("Starting RabbitMQ consumer"); let num_rabbits = std::env::var("NUM_SCOUTER_RABBITMQ_CONSUMERS") - .unwrap_or_else(|_| "1".to_string()) + .unwrap_or_else(|_| "3".to_string()) .parse::() .map_err(|e| lapin::Error::from(std::io::Error::new(std::io::ErrorKind::Other, e)))?;