Avoid double-execution within a round; see syndicate-lang/syndicate-js#3
This commit is contained in:
parent
19cbceda7a
commit
461ac034f8
|
@ -1547,9 +1547,12 @@ impl<'activation> Activation<'activation> {
|
||||||
pass_number += 1;
|
pass_number += 1;
|
||||||
tracing::trace!(?pass_number, "repair_dataflow");
|
tracing::trace!(?pass_number, "repair_dataflow");
|
||||||
let damaged_field_ids = self.state.dataflow.take_damaged_nodes();
|
let damaged_field_ids = self.state.dataflow.take_damaged_nodes();
|
||||||
|
let mut executed_blocks = Set::new();
|
||||||
for field_id in damaged_field_ids.into_iter() {
|
for field_id in damaged_field_ids.into_iter() {
|
||||||
let block_ids = self.state.dataflow.take_observers_of(&field_id);
|
let block_ids = self.state.dataflow.take_observers_of(&field_id);
|
||||||
for block_id in block_ids.into_iter() {
|
for block_id in block_ids.into_iter() {
|
||||||
|
if !executed_blocks.contains(&block_id) {
|
||||||
|
executed_blocks.insert(block_id);
|
||||||
if let Some((facet_id, mut block)) = self.state.blocks.remove(&block_id) {
|
if let Some((facet_id, mut block)) = self.state.blocks.remove(&block_id) {
|
||||||
let result = self.with_facet(facet_id, |t| t.with_block(block_id, &mut block));
|
let result = self.with_facet(facet_id, |t| t.with_block(block_id, &mut block));
|
||||||
self.state.blocks.insert(block_id, (facet_id, block));
|
self.state.blocks.insert(block_id, (facet_id, block));
|
||||||
|
@ -1558,6 +1561,7 @@ impl<'activation> Activation<'activation> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if pass_number > 0 {
|
if pass_number > 0 {
|
||||||
tracing::trace!(passes = ?pass_number, "repair_dataflow complete");
|
tracing::trace!(passes = ?pass_number, "repair_dataflow complete");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue