mirror of https://github.com/rancher/ui.git
Parallelize delete
This commit is contained in:
parent
9ee2e7c529
commit
26b965e6d7
|
|
@ -26,17 +26,28 @@ export default Component.extend(ModalBase, {
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
confirm: function() {
|
confirm: function() {
|
||||||
this.get('resources').forEach((resource) => {
|
const resources = this.get('resources').slice().reverse();
|
||||||
|
async.eachLimit(resources, 5, function(resource, cb) {
|
||||||
|
if ( !resource ) {
|
||||||
|
return cb();
|
||||||
|
}
|
||||||
|
|
||||||
if ( resource.cb ) {
|
if ( resource.cb ) {
|
||||||
resource.cb();
|
const out = resource.cb();
|
||||||
|
if ( out && out.finally ) {
|
||||||
|
out.finally(cb);
|
||||||
|
} else {
|
||||||
|
cb();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
resource.delete();
|
resource.delete().finally(cb);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.send('cancel');
|
this.send('cancel');
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
isEnvironment: computed('resources', function() {
|
isEnvironment: computed('resources', function() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue