Skip to content

Commit cc0a767

Browse files
committed
fix stop block implementation for test-run
1 parent bf381e7 commit cc0a767

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

core/src/subgraph/instance_manager.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -623,16 +623,6 @@ where
623623

624624
let block_ptr = block.ptr();
625625

626-
match ctx.inputs.stop_block.clone() {
627-
Some(stop_block) => {
628-
if block_ptr.number > stop_block {
629-
info!(&logger, "stop block reached for subgraph");
630-
return Ok(());
631-
}
632-
}
633-
_ => {}
634-
}
635-
636626
if block.trigger_count() > 0 {
637627
subgraph_metrics
638628
.block_trigger_count
@@ -680,6 +670,16 @@ where
680670
let elapsed = start.elapsed().as_secs_f64();
681671
subgraph_metrics.block_processing_duration.observe(elapsed);
682672

673+
match ctx.inputs.stop_block.clone() {
674+
Some(stop_block) => {
675+
if block_ptr.number > stop_block {
676+
info!(&logger, "stop block reached for subgraph");
677+
return Ok(());
678+
}
679+
}
680+
_ => {}
681+
}
682+
683683
match res {
684684
Ok(needs_restart) => {
685685
// Keep trying to unfail subgraph for everytime it advances block(s) until it's

node/src/manager/commands/test_run.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ pub async fn run(
196196
info!(&logger, "subgraph now at block {}, reached stop block {}", block_ptr.number, stop_block);
197197
break;
198198
}
199+
info!(&logger, "subgraph not at block ok, block {}, wanted {}", block_ptr.number, stop_block);
199200

200201
}
201202
info!(&logger, "Removing subgraph {}", name);

0 commit comments

Comments
 (0)