Don't double load freshly loaded allocations

This commit is contained in:
Michael Lange 2020-05-12 21:28:40 -07:00
parent de74239430
commit ea7b8b1a11
2 changed files with 9 additions and 2 deletions

View File

@ -80,7 +80,9 @@ async function qualifyAllocation() {
// Make sure the allocation is a complete record and not a partial so we
// can show information such as preemptions and rescheduled allocation.
await allocation.reload();
if (allocation.isPartial) {
await allocation.reload();
}
if (allocation.get('job.isPending')) {
// Make sure the job is loaded before starting the stats tracker

View File

@ -1,6 +1,6 @@
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
import { equal } from '@ember/object/computed';
import { equal, none } from '@ember/object/computed';
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { belongsTo, hasMany } from 'ember-data/relationships';
@ -43,6 +43,11 @@ export default Model.extend({
isRunning: equal('clientStatus', 'running'),
isMigrating: attr('boolean'),
// An allocation model created from any allocation list response will be lacking
// many properties (some of which can always be null). This is an indicator that
// the allocation needs to be reloaded to get the complete allocation state.
isPartial: none('allocationTaskGroup'),
// When allocations are server-side rescheduled, a paper trail
// is left linking all reschedule attempts.
previousAllocation: belongsTo('allocation', { inverse: 'nextAllocation' }),