Skip to content

Commit

Permalink
Remove indices vec in recover()
Browse files Browse the repository at this point in the history
  • Loading branch information
ekmartin committed Nov 8, 2017
1 parent 6fbae6f commit 1a62618
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/flow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,21 +509,15 @@ impl ControllerInner {
/// StartRecovery packet to each base node domain.
pub fn recover(&mut self, _: ()) {
info!(self.log, "Recovering from log");
let indices = self.inputs(())
.iter()
.map(|(_name, index)| {
let node = &self.ingredients[*index];
node.domain()
})
.collect::<Vec<_>>();

for index in indices.clone() {
let domain = self.domains.get_mut(&index).unwrap();
for (_name, index) in self.inputs(()).iter() {
let node = &self.ingredients[*index];
let domain = self.domains.get_mut(&node.domain()).unwrap();
domain.send(box payload::Packet::StartRecovery).unwrap();
}

for index in indices {
let domain = self.domains.get_mut(&index).unwrap();
for (_name, index) in self.inputs(()).iter() {
let node = &self.ingredients[*index];
let domain = self.domains.get_mut(&node.domain()).unwrap();
domain.wait_for_ack().unwrap();
}
}
Expand Down

0 comments on commit 1a62618

Please sign in to comment.