fix(asyncgit): log diff/blame notification channel errors

Avoid panicking when the UI channel is closed while async diff or
blame workers finish, matching the status worker pattern.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuyangfan 2026-05-17 18:51:31 +08:00
parent 8619c07f3f
commit 73be3f5247
2 changed files with 14 additions and 14 deletions

View file

@ -124,13 +124,13 @@ impl AsyncBlame {
arc_pending.fetch_sub(1, Ordering::Relaxed);
sender
.send(if notify {
AsyncGitNotification::Blame
} else {
AsyncGitNotification::FinishUnchanged
})
.expect("error sending blame");
if let Err(e) = sender.send(if notify {
AsyncGitNotification::Blame
} else {
AsyncGitNotification::FinishUnchanged
}) {
log::error!("blame notify error: {e}");
}
});
Ok(None)

View file

@ -140,13 +140,13 @@ impl AsyncDiff {
arc_pending.fetch_sub(1, Ordering::Relaxed);
sender
.send(if notify {
AsyncGitNotification::Diff
} else {
AsyncGitNotification::FinishUnchanged
})
.expect("error sending diff");
if let Err(e) = sender.send(if notify {
AsyncGitNotification::Diff
} else {
AsyncGitNotification::FinishUnchanged
}) {
log::error!("diff notify error: {e}");
}
});
Ok(None)