mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
Implement abortAllActions to cancel actions
This commit is contained in:
parent
b1b446f55a
commit
69f0c3f142
@ -466,7 +466,31 @@ export class WorkbenchStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abortAllActions() {
|
abortAllActions() {
|
||||||
// TODO: what do we wanna do and how do we wanna recover from this?
|
// Reset any queued actions so nothing new runs
|
||||||
|
this.#globalExecutionQueue = Promise.resolve();
|
||||||
|
|
||||||
|
// Abort currently running command in the shell if there is one
|
||||||
|
const execution = this.boltTerminal.executionState.get();
|
||||||
|
|
||||||
|
if (execution?.active) {
|
||||||
|
execution.abort?.();
|
||||||
|
|
||||||
|
// Send CTRL+C to ensure the process is interrupted
|
||||||
|
this.boltTerminal.terminal?.input('\x03');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Abort all actions for every artifact
|
||||||
|
const artifacts = this.artifacts.get();
|
||||||
|
|
||||||
|
for (const artifact of Object.values(artifacts)) {
|
||||||
|
const actions = artifact.runner.actions.get();
|
||||||
|
|
||||||
|
for (const action of Object.values(actions)) {
|
||||||
|
if (action.status === 'running' || action.status === 'pending') {
|
||||||
|
action.abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setReloadedMessages(messages: string[]) {
|
setReloadedMessages(messages: string[]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user