WIP: Allow jobs to be submitted in paused status #104318

Closed
David Zhang wants to merge 32 commits from David-Zhang-10/flamenco:submit-as-paused into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
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']);
}, },