Skip to content

Commit

Permalink
Fix WebSocketClient post_disconnection messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Oct 3, 2024
1 parent ec2d7c9 commit dc1f18c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nautilus_core/network/src/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ impl WebSocketClient {
sleep(Duration::from_millis(100)).await;

// Check if client needs to disconnect
let disconnected = disconnect_mode.load(Ordering::SeqCst);
match (disconnected, inner.is_alive()) {
let disconnect = disconnect_mode.load(Ordering::SeqCst);
match (disconnect, inner.is_alive()) {
(false, false) => match inner.reconnect().await {
Ok(()) => {
tracing::debug!("Reconnected successfully");
Expand All @@ -434,10 +434,10 @@ impl WebSocketClient {
inner.shutdown().await;
if let Some(ref handler) = post_disconnection {
Python::with_gil(|py| match handler.call0(py) {
Ok(_) => tracing::debug!("Called `post_reconnection` handler"),
Ok(_) => tracing::debug!("Called `post_disconnection` handler"),
Err(e) => {
tracing::error!(
"Error calling `post_reconnection` handler: {e}"
"Error calling `post_disconnection` handler: {e}"
);
}
});
Expand Down

0 comments on commit dc1f18c

Please sign in to comment.