Skip to content

Commit

Permalink
Cleanup websocket tasks on disconnect if it is not alive
Browse files Browse the repository at this point in the history
  • Loading branch information
twitu committed Oct 3, 2024
1 parent dc1f18c commit 61efc26
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nautilus_core/network/src/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,12 @@ impl WebSocketClient {
}
break;
}
(true, false) => break,
// Close the heartbeat task on disconnect if the connection is already closed
(true, false) => {
tracing::debug!("Inner client is disconnected");
tracing::debug!("Shutting down inner client to clean up running tasks");
inner.shutdown().await
}
_ => (),
}
}
Expand Down

0 comments on commit 61efc26

Please sign in to comment.