refactor: extract is_aborted helpers, DRY 16 call sites
This commit is contained in:
@@ -198,7 +198,7 @@ impl LlmClient {
|
||||
|
||||
// Check abort before each retry so user cancellation is
|
||||
// responsive even during a long non-streaming backoff chain.
|
||||
if abort_flag.is_some_and(|f| f.load(std::sync::atomic::Ordering::SeqCst)) {
|
||||
if crate::app::util::abort::is_aborted_ref(abort_flag) {
|
||||
anyhow::bail!("aborted");
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ impl LlmClient {
|
||||
if meaningful_content {
|
||||
// Check abort before entering the blocking non-streaming
|
||||
// call — otherwise the fallback ignores user cancellation.
|
||||
if abort_flag.is_some_and(|f| f.load(std::sync::atomic::Ordering::SeqCst)) {
|
||||
if crate::app::util::abort::is_aborted_ref(abort_flag) {
|
||||
return Err(anyhow::anyhow!("aborted"));
|
||||
}
|
||||
tracing::warn!(
|
||||
|
||||
Reference in New Issue
Block a user