Skip to content

Commit

Permalink
user-ingest: Use separate connection for public vhost
Browse files Browse the repository at this point in the history
  • Loading branch information
raimannma committed Oct 15, 2024
1 parent babe6c6 commit 8aabb5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion user-ingest/src/rmq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ static RABBITMQ_HOST: LazyLock<String> = LazyLock::new(|| std::env::var("RABBITM
static RABBITMQ_PORT: LazyLock<String> = LazyLock::new(|| std::env::var("RABBITMQ_PORT").unwrap());

static RABBITMQ_CONNECTION: OnceCell<Connection> = OnceCell::const_new();
static RABBITMQ_PUBLIC_CONNECTION: OnceCell<Connection> = OnceCell::const_new();
static RABBITMQ_CHANNEL: OnceCell<Channel> = OnceCell::const_new();
static RABBITMQ_PUBLIC_CHANNEL: OnceCell<Channel> = OnceCell::const_new();

Expand Down Expand Up @@ -73,7 +74,7 @@ async fn get_rmq_channel() -> Result<&'static Channel, ProcessError> {
}

async fn get_rmq_public_channel() -> Result<&'static Channel, ProcessError> {
let connection = RABBITMQ_CONNECTION
let connection = RABBITMQ_PUBLIC_CONNECTION
.get_or_try_init(|| async {
Connection::connect(
&format!(
Expand Down

0 comments on commit 8aabb5a

Please sign in to comment.