Compare commits

...

3 Commits

Author SHA1 Message Date
62a1653198 debuggin 2021-07-21 15:33:24 -07:00
9e8fd167ee correct key for abort signal 2021-07-21 15:12:29 -07:00
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.buildOptionsFromConfiguration = this.buildOptionsFromConfiguration.bind(this);
this.abortControllers = [];
this.filterObserver = undefined;
this.createTableRowCollections();
@ -172,14 +174,23 @@ define([
requestDataFor(telemetryObject) {
this.incrementOutstandingRequests();
let requestOptions = this.buildOptionsFromConfiguration(telemetryObject);
let abortController = new AbortController();
requestOptions.signal = abortController.signal;
this.abortControllers.push(abortController);
return this.openmct.telemetry.request(telemetryObject, requestOptions)
.then(telemetryData => {
//Check that telemetry object has not been removed since telemetry was requested.
if (!this.telemetryObjects.includes(telemetryObject)) {
abortController.abort();
return;
}
this.abortControllers = this.abortControllers.filter(controller => controller !== abortController);
let keyString = this.openmct.objects.makeKeyString(telemetryObject.identifier);
let columnMap = this.getColumnMapForObject(keyString);
let limitEvaluator = this.openmct.telemetry.limitEvaluator(telemetryObject);
@ -352,6 +363,8 @@ define([
destroy() {
this.boundedRows.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);
this.openmct.time.off('bounds', this.refreshData);
this.openmct.time.off('timeSystem', this.refreshData);