Compare commits

...

3 Commits

Author SHA1 Message Date
Jamie Vigliotta
62a1653198 debuggin 2021-07-21 15:33:24 -07:00
Jamie Vigliotta
9e8fd167ee correct key for abort signal 2021-07-21 15:12:29 -07:00
Jamie Vigliotta
f778131d09 adding abort controllers to telemetry tables 2021-07-21 14:25:09 -07:00

View File

@@ -65,6 +65,8 @@ define([
this.updateFilters = this.updateFilters.bind(this); this.updateFilters = this.updateFilters.bind(this);
this.buildOptionsFromConfiguration = this.buildOptionsFromConfiguration.bind(this); this.buildOptionsFromConfiguration = this.buildOptionsFromConfiguration.bind(this);
this.abortControllers = [];
this.filterObserver = undefined; this.filterObserver = undefined;
this.createTableRowCollections(); this.createTableRowCollections();
@@ -172,14 +174,23 @@ define([
requestDataFor(telemetryObject) { requestDataFor(telemetryObject) {
this.incrementOutstandingRequests(); this.incrementOutstandingRequests();
let requestOptions = this.buildOptionsFromConfiguration(telemetryObject); let requestOptions = this.buildOptionsFromConfiguration(telemetryObject);
let abortController = new AbortController();
requestOptions.signal = abortController.signal;
this.abortControllers.push(abortController);
return this.openmct.telemetry.request(telemetryObject, requestOptions) return this.openmct.telemetry.request(telemetryObject, requestOptions)
.then(telemetryData => { .then(telemetryData => {
//Check that telemetry object has not been removed since telemetry was requested. //Check that telemetry object has not been removed since telemetry was requested.
if (!this.telemetryObjects.includes(telemetryObject)) { if (!this.telemetryObjects.includes(telemetryObject)) {
abortController.abort();
return; return;
} }
this.abortControllers = this.abortControllers.filter(controller => controller !== abortController);
let keyString = this.openmct.objects.makeKeyString(telemetryObject.identifier); let keyString = this.openmct.objects.makeKeyString(telemetryObject.identifier);
let columnMap = this.getColumnMapForObject(keyString); let columnMap = this.getColumnMapForObject(keyString);
let limitEvaluator = this.openmct.telemetry.limitEvaluator(telemetryObject); let limitEvaluator = this.openmct.telemetry.limitEvaluator(telemetryObject);
@@ -352,6 +363,8 @@ define([
destroy() { destroy() {
this.boundedRows.destroy(); this.boundedRows.destroy();
this.filteredRows.destroy(); this.filteredRows.destroy();
console.log('telemetry table js destroy', this.abortControllers);
this.abortControllers.forEach(controller => controller.abort());
Object.keys(this.subscriptions).forEach(this.unsubscribe, this); Object.keys(this.subscriptions).forEach(this.unsubscribe, this);
this.openmct.time.off('bounds', this.refreshData); this.openmct.time.off('bounds', this.refreshData);
this.openmct.time.off('timeSystem', this.refreshData); this.openmct.time.off('timeSystem', this.refreshData);