Remove n+1 host calls (rancher/rancher#3976)

This commit is contained in:
Vincent Fiduccia 2016-03-22 14:06:20 -07:00
parent d0a1445233
commit d97d52a1be
1 changed files with 1 additions and 14 deletions

View File

@ -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() {