diff --git a/v4-client-rs/client/src/indexer/rest/types.rs b/v4-client-rs/client/src/indexer/rest/types.rs index 649b1cb9..578de684 100644 --- a/v4-client-rs/client/src/indexer/rest/types.rs +++ b/v4-client-rs/client/src/indexer/rest/types.rs @@ -26,10 +26,6 @@ pub struct ErrorMsg { pub location: String, } -/// Profit and loss tick id. -#[derive(Deserialize, Debug, Clone, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub struct PnlTickId(pub String); - /// PnL tick resolution. #[derive( Deserialize, Serialize, Debug, Clone, Copy, From, Display, PartialEq, Eq, PartialOrd, Ord, Hash, @@ -250,10 +246,6 @@ pub struct HistoricalPnlResponse { #[derive(Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct PnlTicksResponseObject { - /// Report id. - pub id: PnlTickId, - /// Subaccount id. - pub subaccount_id: SubaccountId, /// Block height. pub block_height: Height, /// Time (UTC). diff --git a/v4-client-rs/client/src/indexer/sock/feed.rs b/v4-client-rs/client/src/indexer/sock/feed.rs index 375e767d..eac15334 100644 --- a/v4-client-rs/client/src/indexer/sock/feed.rs +++ b/v4-client-rs/client/src/indexer/sock/feed.rs @@ -50,8 +50,10 @@ where impl> Drop for Feed { fn drop(&mut self) { - if let Err(err) = self.ctrl.send(ControlMsg::Unsubscribe(self.sub.clone())) { - log::error!("Sending of Unsubscribe control message to connector failed: {err}"); + if !self.ctrl.is_closed() { + if let Err(err) = self.ctrl.send(ControlMsg::Unsubscribe(self.sub.clone())) { + log::error!("Sending of Unsubscribe control message to connector failed: {err}"); + } } } } diff --git a/v4-client-rs/client/src/indexer/sock/mod.rs b/v4-client-rs/client/src/indexer/sock/mod.rs index 448ffdbd..dc27e023 100644 --- a/v4-client-rs/client/src/indexer/sock/mod.rs +++ b/v4-client-rs/client/src/indexer/sock/mod.rs @@ -62,8 +62,10 @@ impl SockClient { impl Drop for SockClient { fn drop(&mut self) { - if let Err(e) = self.conn_tx.send(ControlMsg::Terminate) { - log::error!("Failed sending control Terminate to WebSocket connector: {e}"); + if !self.conn_tx.is_closed() { + if let Err(e) = self.conn_tx.send(ControlMsg::Terminate) { + log::error!("Failed sending control Terminate to WebSocket connector: {e}"); + } } } }