Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
turulix committed Oct 10, 2023
1 parent b51742a commit c8812e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion memphis/src/memphis_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use async_nats::connection::State;
use async_nats::jetstream::Context;
use async_nats::{jetstream, Client, ConnectError, ConnectOptions, Event, Message};
use bytes::Bytes;
use log::info;
use log::{error, info};
use serde::Serialize;
use uuid::Uuid;

Expand Down Expand Up @@ -96,6 +96,10 @@ impl MemphisClient {
}
};

while connection.connection_state() == State::Pending {
tokio::time::sleep(Duration::from_millis(50)).await;
}

Ok(MemphisClient {
jetstream_context: Arc::new(jetstream::new(connection.clone())),
broker_connection: Arc::new(connection),
Expand Down

0 comments on commit c8812e9

Please sign in to comment.