Support pausing jobs #104313

Manually merged
Sybren A. Stüvel merged 28 commits from David-Zhang-10/flamenco:paused-job-status into main 2024-07-01 17:53:44 +02:00
3 changed files with 9 additions and 3 deletions
Showing only changes of commit ba454cd4a0 - Show all commits

View File

@ -72,6 +72,9 @@ export default {
onButtonRequeue() {
return this._handleJobActionPromise(this.jobs.requeueJobs(), 'requeueing');
},
onButtonPause() {
return this._handleJobActionPromise(this.jobs.pauseJobs(), 'marked for pausing');
},
_handleJobActionPromise(promise, description) {
return promise.then(() => {

View File

@ -33,6 +33,9 @@ export const useJobs = defineStore('jobs', {
canRequeue() {
return this._anyJobWithStatus(['canceled', 'completed', 'failed', 'paused']);
},
canPause() {
return this._anyJobWithStatus(['active', 'queued', 'canceled']);
},
},
actions: {
setIsJobless(isJobless) {
@ -74,6 +77,9 @@ export const useJobs = defineStore('jobs', {
cancelJobs() {
return this._setJobStatus('cancel-requested');
},
pauseJobs() {
return this._setJobStatus('pause-requested');
},
requeueJobs() {
return this._setJobStatus('requeueing');
},

View File

@ -18,9 +18,6 @@ export const useTasks = defineStore('tasks', {
activeTaskID: '',
}),
getters: {
canPause() {
return this._anyTaskWithStatus(['active', 'queued', 'cancelled']);
},
canCancel() {
return this._anyTaskWithStatus(['queued', 'active', 'soft-failed']);
},