protocol/service: defensive storage.contains check

In the case of the `storage.contains` call returning an error, it
would be preferable to log the error and continue checking for missing
repositories.
This commit is contained in:
Fintan Halpenny 2025-12-17 13:57:25 +00:00 committed by Lorenz Leutgeb
parent a46f8eb1d5
commit 47dc2c562c
1 changed files with 10 additions and 2 deletions

View File

@ -2530,8 +2530,16 @@ where
if !policy.is_allow() { if !policy.is_allow() {
continue; continue;
} }
if self.storage.contains(&rid)? { match self.storage.contains(&rid) {
continue; Ok(exists) => {
if exists {
continue;
}
}
Err(err) => {
log::warn!(target: "protocol::filter", "Failed to check if {rid} exists: {err}");
continue;
}
} }
match self.seeds(&rid, [self.node_id()].into()) { match self.seeds(&rid, [self.node_id()].into()) {
Ok(seeds) => { Ok(seeds) => {