Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 61f588c

Browse files
committed
review feedback
1 parent f6f234c commit 61f588c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

program-runtime/src/loaded_programs.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,17 +648,18 @@ impl<FG: ForkGraph> LoadedPrograms<FG> {
648648
error!("Program cache doesn't have fork graph.");
649649
return;
650650
};
651+
let Ok(fork_graph) = fork_graph.read() else {
652+
error!("Failed to lock fork graph for reading.");
653+
return;
654+
};
651655
for second_level in self.entries.values_mut() {
652656
// Remove entries un/re/deployed on orphan forks
653657
let mut first_ancestor_found = false;
654658
*second_level = second_level
655659
.iter()
656660
.rev()
657661
.filter(|entry| {
658-
let relation = fork_graph
659-
.read()
660-
.unwrap()
661-
.relationship(entry.deployment_slot, new_root_slot);
662+
let relation = fork_graph.relationship(entry.deployment_slot, new_root_slot);
662663
if entry.deployment_slot >= new_root_slot {
663664
matches!(relation, BlockRelation::Equal | BlockRelation::Descendant)
664665
} else if !first_ancestor_found

0 commit comments

Comments
 (0)