Skip to content

Commit

Permalink
rm useless event
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanKung committed Jul 7, 2023
1 parent 61c03a0 commit be9b804
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
16 changes: 1 addition & 15 deletions core/src/message/handlers/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ pub async fn handle_join_dht(act: PeerRingAction) -> Result<Vec<MessageHandlerEv
Ok(vec![])
}
}
/// A new successor is set, request the new successor for it's successor list
PeerRingAction::RemoteAction(next, PeerRingRemoteAction::QueryForSuccessorList) => {
Ok(vec![MessageHandlerEvent::SendDirectMessage(
Message::QueryForTopoInfoSend(QueryForTopoInfoSend { did: next }),
Expand Down Expand Up @@ -308,21 +309,6 @@ impl HandleMsg<FindSuccessorReport> for MessageHandler {
Ok(vec![MessageHandlerEvent::JoinDHT(msg.did)])
}
FindSuccessorReportHandler::Connect => Ok(vec![MessageHandlerEvent::Connect(msg.did)]),
FindSuccessorReportHandler::SyncStorage => {
self.dht.successors().update(msg.did)?;
if let Ok(PeerRingAction::RemoteAction(
next,
PeerRingRemoteAction::SyncVNodeWithSuccessor(data),
)) = self.dht.sync_vnode_with_successor(msg.did).await
{
Ok(vec![MessageHandlerEvent::SendMessage(
Message::SyncVNodeWithSuccessor(SyncVNodeWithSuccessor { data }),
next,
)])
} else {
Ok(vec![])
}
}
_ => Ok(vec![]),
}
}
Expand Down
2 changes: 0 additions & 2 deletions core/src/message/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ pub enum FindSuccessorReportHandler {
Connect,
/// - FixFingerTable: update fingers table.
FixFingerTable,
/// - SyncStorage: syncing data in virtual node.
SyncStorage,
/// - CustomCallback: custom callback handle by `custom_message` method.
CustomCallback(u8),
}
Expand Down

0 comments on commit be9b804

Please sign in to comment.