mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-09 01:35:18 +02:00
Use if-let shape for refresh outcome handling
Switch from match-on-Result to if-let-Err so the refresh outcome and merge_result outcome are checked independently, making the intent clearer: 'attempt refresh; on Ok-merge-with-refresh-error propagate; on Err-merge-with-refresh-error log and surface the original merge error'. No semantic change — both shapes were valid (wildcard patterns don't move the scrutinee) — but the if-let form sidesteps a needs-second-reading question raised in code review. Co-Authored-By: Ragnor Comerford <ragnor.comerford@gmail.com>
This commit is contained in:
parent
7d1a40102c
commit
a6c7e5fab5
1 changed files with 8 additions and 10 deletions
|
|
@ -1144,17 +1144,15 @@ impl Omnigraph {
|
|||
// that with a less informative error; the next op or the next
|
||||
// `Omnigraph::open` will re-sync the coord anyway.
|
||||
if previous_branch == target_branch {
|
||||
match merge_result {
|
||||
Ok(_) => self.refresh_coordinator_only().await?,
|
||||
Err(_) => {
|
||||
if let Err(err) = self.refresh_coordinator_only().await {
|
||||
tracing::warn!(
|
||||
error = %err,
|
||||
"post-merge coordinator refresh failed on the error path; \
|
||||
the next op or open will re-sync"
|
||||
);
|
||||
}
|
||||
if let Err(refresh_err) = self.refresh_coordinator_only().await {
|
||||
if merge_result.is_ok() {
|
||||
return Err(refresh_err);
|
||||
}
|
||||
tracing::warn!(
|
||||
error = %refresh_err,
|
||||
"post-merge coordinator refresh failed on the error path; \
|
||||
the next op or open will re-sync"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue