Skip to content

Commit ccead8e

Browse files
committed
[O2B-1528] Use per-run GAQ summary remote data sources
Replace the single _gaqSummarySource with a map (_gaqSummarySources) keyed by runNumber so each run gets its own RemoteDataSource. Will allow easy changing to parallel requests in the future.
1 parent 58081a4 commit ccead8e

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class RunsPerDataPassOverviewModel extends FixedPdpBeamTypeRunsOverviewMo
6262
this._gaqSummary$ = new ObservableData({});
6363
this._gaqSummary$.bubbleTo(this);
6464

65-
this._gaqSummarySource = null;
65+
this._gaqSummarySources = {};
6666
this._gaqSequenceAbortController = null;
6767

6868
this._skimmableRuns$ = new ObservableData(RemoteData.notAsked());
@@ -338,8 +338,10 @@ export class RunsPerDataPassOverviewModel extends FixedPdpBeamTypeRunsOverviewMo
338338
// Aborts the overall sequence fetch, i.e. stops further individual run fetches
339339
this._gaqSequenceAbortController?.abort();
340340

341-
// Aborts individual run fetch in-flight
342-
this._gaqSummarySource?._abortController?.abort();
341+
// Aborts individual run fetches in-flight
342+
for (const runNumber in this._gaqSummarySources) {
343+
this._gaqSummarySources[runNumber]?._abortController?.abort();
344+
}
343345
}
344346

345347
/**
@@ -348,9 +350,9 @@ export class RunsPerDataPassOverviewModel extends FixedPdpBeamTypeRunsOverviewMo
348350
* @return {Promise<void>} resolves once data has been fetched
349351
*/
350352
async _fetchGaqSummary(runNumber) {
351-
this._gaqSummarySource = new RemoteDataSource();
353+
this._gaqSummarySources[runNumber] = new RemoteDataSource();
352354
// Pipe the result into the correct slot in the gaqSummary$ observable
353-
this._gaqSummarySource.pipe({
355+
this._gaqSummarySources[runNumber].pipe({
354356
setCurrent: (remoteData) => {
355357
const current = this._gaqSummary$.getCurrent();
356358
this._gaqSummary$.setCurrent({
@@ -364,7 +366,7 @@ export class RunsPerDataPassOverviewModel extends FixedPdpBeamTypeRunsOverviewMo
364366
mcReproducibleAsNotBad: this._mcReproducibleAsNotBad,
365367
runNumber: runNumber,
366368
});
367-
await this._gaqSummarySource.fetch(url);
369+
await this._gaqSummarySources[runNumber].fetch(url);
368370
}
369371

370372
/**
@@ -396,13 +398,7 @@ export class RunsPerDataPassOverviewModel extends FixedPdpBeamTypeRunsOverviewMo
396398
return;
397399
}
398400

399-
try {
400-
await this._fetchGaqSummary(runNumber);
401-
} catch {
402-
if (signal.aborted) {
403-
return;
404-
}
405-
}
401+
await this._fetchGaqSummary(runNumber);
406402
}
407403
},
408404
Other: () => {

0 commit comments

Comments
 (0)