Skip to content

Commit e681ca3

Browse files
committed
refactor: Remove unnecessary .health call and use unfail outcome instead
1 parent e7c8333 commit e681ca3

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

core/src/subgraph/instance_manager.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -653,24 +653,17 @@ where
653653
if should_try_unfail_non_deterministic {
654654
// If the deployment head advanced, we can unfail
655655
// the non-deterministic error (if there's any).
656-
let _outcome = ctx
656+
let outcome = ctx
657657
.inputs
658658
.store
659659
.unfail_non_deterministic_error(&block_ptr)?;
660660

661-
match ctx.inputs.store.health(&ctx.inputs.deployment.hash).await? {
662-
SubgraphHealth::Failed => {
663-
// If the unfail call didn't change the subgraph health, we keep
664-
// `should_try_unfail_non_deterministic` as `true` until it's
665-
// actually unfailed.
666-
}
667-
SubgraphHealth::Healthy | SubgraphHealth::Unhealthy => {
668-
// Stop trying to unfail.
669-
should_try_unfail_non_deterministic = false;
670-
deployment_failed.set(0.0);
671-
backoff.reset();
672-
}
673-
};
661+
if let UnfailOutcome::Unfailed = outcome {
662+
// Stop trying to unfail.
663+
should_try_unfail_non_deterministic = false;
664+
deployment_failed.set(0.0);
665+
backoff.reset();
666+
}
674667
}
675668

676669
// Notify the BlockStream implementation that a block was succesfully consumed

0 commit comments

Comments
 (0)