Support pausing jobs #104313
@ -23,10 +23,17 @@ export const useTasks = defineStore('tasks', {
|
|||||||
const jobs = useJobs();
|
const jobs = useJobs();
|
||||||
const activeJob = jobs.activeJob;
|
const activeJob = jobs.activeJob;
|
||||||
|
|
||||||
// Check if the job status is 'pause-requested'.
|
if (!activeJob) {
|
||||||
if (activeJob && activeJob.status === 'pause-requested') {
|
console.warn('no active job, unable to determine whether the active task is cancellable');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (activeJob.status == 'pause-requested') {
|
||||||
|
// Cancelling a task should not be possible while the job is being paused.
|
||||||
|
// In the future this might be supported, see issue #104315.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Allow cancellation for specified task statuses.
|
// Allow cancellation for specified task statuses.
|
||||||
return this._anyTaskWithStatus(['queued', 'active', 'soft-failed']);
|
return this._anyTaskWithStatus(['queued', 'active', 'soft-failed']);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user