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() { onButtonRequeue() {
return this._handleJobActionPromise(this.jobs.requeueJobs(), 'requeueing'); return this._handleJobActionPromise(this.jobs.requeueJobs(), 'requeueing');
}, },
onButtonPause() {
return this._handleJobActionPromise(this.jobs.pauseJobs(), 'marked for pausing');
},
_handleJobActionPromise(promise, description) { _handleJobActionPromise(promise, description) {
return promise.then(() => { return promise.then(() => {

View File

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

View File

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