chore(xen-api): TODO do not cancel a finished task
This commit is contained in:
parent
6abf3fc0af
commit
7fd615525a
@ -408,6 +408,7 @@ export class Xapi extends EventEmitter {
|
|||||||
? Promise.reject(new Error(`cannot call ${method}() in read only mode`))
|
? Promise.reject(new Error(`cannot call ${method}() in read only mode`))
|
||||||
: this._sessionCall(`Async.${method}`, args).then(taskRef => {
|
: this._sessionCall(`Async.${method}`, args).then(taskRef => {
|
||||||
$cancelToken.promise.then(() => {
|
$cancelToken.promise.then(() => {
|
||||||
|
// TODO: do not trigger if the task is already over
|
||||||
this._sessionCall('task.cancel', [taskRef]).catch(noop)
|
this._sessionCall('task.cancel', [taskRef]).catch(noop)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user