Handle task progress and termination (in plugin forms)
This commit is contained in:
parent
e2efa92232
commit
70533438d2
3 changed files with 209 additions and 7 deletions
11
src/store.js
11
src/store.js
|
|
@ -162,8 +162,19 @@ export default new Vuex.Store({
|
|||
}
|
||||
// If task ends with an error
|
||||
else if (result == 'error') {
|
||||
// Pass the error string back with reject
|
||||
reject(new Error(response.data.return))
|
||||
}
|
||||
// If task ends with termination
|
||||
else if (result == 'terminated') {
|
||||
// Pass a generic termination error back with reject
|
||||
reject(new Error("Task terminated"))
|
||||
}
|
||||
// If task ends in any other way
|
||||
else if (result != 'running') {
|
||||
// Pass status string as error
|
||||
reject(new Error(result))
|
||||
}
|
||||
// If the condition isn't met but the timeout hasn't elapsed, go again
|
||||
else if (Number(new Date()) < endTime) {
|
||||
setTimeout(checkCondition, interval, resolve, reject)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue