forked from 1b-agent/fieldcraft-upstream
jobs: Cancel and job.cancel interrupt the running command (#371)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
5fcbee028e
commit
5aace9b5b3
8 files changed
+176
-8
No files matched your search
@@ -676,9 +676,12 @@ impl ModelApp {
|
||||
);
|
||||
}
|
||||
|
||||
/// Stop waiting for the background job; the model stays as it was.
|
||||
/// Cancel the background job: its command stops at its next check
|
||||
/// ([`fieldcraft_model::progress::check`]) and what it made is dropped; the model stays as
|
||||
/// it was.
|
||||
pub fn cancel_loading(&mut self) {
|
||||
if let Some(l) = self.loading.take() {
|
||||
l.progress.cancel();
|
||||
self.queued.clear();
|
||||
for w in &l.waiters {
|
||||
let _ = w.send(json!({"ok": false, "error": format!("cancelled: {}", l.title), "cancelled": true}));
|
||||
|
||||
Reference in new issue
Block a user