Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions v4-client-rs/client/src/indexer/rest/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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).
Expand Down
6 changes: 4 additions & 2 deletions v4-client-rs/client/src/indexer/sock/feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ where

impl<T: TryFrom<FeedMessage>> Drop for Feed<T> {
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}");
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions v4-client-rs/client/src/indexer/sock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}
}
}
}
Expand Down