Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: code reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberb committed Jul 20, 2023
1 parent bff866c commit 1faf49c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/topos-tce-broadcast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ default = []
[[bench]]
name = "double_echo"
path = "benches/double_echo.rs"
harness = false
harness = false
11 changes: 5 additions & 6 deletions crates/topos-tce-broadcast/src/task_manager_channels/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ impl TaskManager {
Some(msg) = self.message_receiver.recv() => {
match msg {
DoubleEchoCommand::Echo { certificate_id, .. } | DoubleEchoCommand::Ready{ certificate_id, .. } => {
if let Some(task_context) = self.task_context.get(&certificate_id) {
Self::send_message_to_task(task_context.clone(), msg).await;
let task_context = match self.task_context.get(&certificate_id) {
Some(task_context) => task_context.to_owned(),
None => self.create_and_spawn_new_task(certificate_id, task_completion_sender.clone(), event_sender.clone()),
};

} else {
let task_context = self.create_and_spawn_new_task(certificate_id, task_completion_sender.clone(), event_sender.clone());
Self::send_message_to_task(task_context, msg).await;
}
Self::send_message_to_task(task_context, msg).await;
}
DoubleEchoCommand::Broadcast { ref cert, .. } => {
if self.task_context.get(&cert.id).is_none() {
Expand Down

0 comments on commit 1faf49c

Please sign in to comment.