mirror of https://github.com/rancher/ui.git
Remove n+1 host calls (rancher/rancher#3976)
This commit is contained in:
parent
d0a1445233
commit
d97d52a1be
|
|
@ -5,22 +5,9 @@ export default Ember.Route.extend({
|
|||
statsSocket: null,
|
||||
|
||||
model() {
|
||||
var promises = [];
|
||||
|
||||
// Load the hosts for the instances if they're not already there
|
||||
var service = this.modelFor('service').get('service');
|
||||
var instances = service.get('instances');
|
||||
if (instances) {
|
||||
instances.forEach((instance) => {
|
||||
if (!instance.get('primaryHost')) {
|
||||
promises.push(instance.importLink('hosts'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return Ember.RSVP.all(promises).then(() => {
|
||||
return service;
|
||||
});
|
||||
return service;
|
||||
},
|
||||
|
||||
setupController() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue