Skip to content

Commit

Permalink
fix: actually use websocket config for connection
Browse files Browse the repository at this point in the history
  • Loading branch information
jost-s committed Sep 10, 2024
1 parent 19c1027 commit 9b23ed8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/admin_websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,16 @@ impl AdminWebsocket {
}

/// Connect to a Conductor API AdminWebsocket with a custom WebsocketConfig.
pub async fn connect_with_config(socket_addr: impl ToSocketAddrs, config: Arc<WebsocketConfig>) -> Result<Self> {
pub async fn connect_with_config(
socket_addr: impl ToSocketAddrs,
websocket_config: Arc<WebsocketConfig>,
) -> Result<Self> {
let addr = socket_addr
.to_socket_addrs()?
.next()
.expect("invalid websocket address");
let websocket_config = Arc::new(WebsocketConfig::CLIENT_DEFAULT);

let (tx, mut rx) = again::retry(|| {
let websocket_config = Arc::clone(&websocket_config);
connect(websocket_config, addr)
})
.await?;
let (tx, mut rx) = again::retry(|| connect(websocket_config.clone(), addr)).await?;

// WebsocketReceiver needs to be polled in order to receive responses
// from remote to sender requests.
Expand Down

0 comments on commit 9b23ed8

Please sign in to comment.