From e98eb8228508a96ded20fbaf55c0df2f99429aee Mon Sep 17 00:00:00 2001 From: Rick Saccoccia Date: Sat, 30 Nov 2024 15:01:11 -0700 Subject: [PATCH] [service] fix event deletion and firstRun logic --- plugins/arcgis/service/src/EventDeletionHandler.ts | 4 ++++ plugins/arcgis/service/src/ObservationProcessor.ts | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/arcgis/service/src/EventDeletionHandler.ts b/plugins/arcgis/service/src/EventDeletionHandler.ts index 305485edd..691c69072 100644 --- a/plugins/arcgis/service/src/EventDeletionHandler.ts +++ b/plugins/arcgis/service/src/EventDeletionHandler.ts @@ -34,6 +34,10 @@ export class EventDeletionHandler { this._config = config; } + public updateConfig(newConfig: ArcGISPluginConfig): void { + this._config = newConfig; + } + /** * * @param activeEvents The current set of active events. diff --git a/plugins/arcgis/service/src/ObservationProcessor.ts b/plugins/arcgis/service/src/ObservationProcessor.ts index f925a755e..5abbc4ca4 100644 --- a/plugins/arcgis/service/src/ObservationProcessor.ts +++ b/plugins/arcgis/service/src/ObservationProcessor.ts @@ -178,11 +178,10 @@ export class ObservationProcessor { if (this._previousConfig == null || this._previousConfig != configJson) { this._transformer = new ObservationsTransformer(config, console); this._geometryChangeHandler = new GeometryChangedHandler(this._transformer); - this._eventDeletionHandler = new EventDeletionHandler(this._console, config); + this._eventDeletionHandler.updateConfig(config); this._layerProcessors = []; await this.getFeatureServiceLayers(config); this._previousConfig = configJson - this._firstRun = true; } return config } @@ -192,7 +191,6 @@ export class ObservationProcessor { */ async start() { this._isRunning = true; - this._firstRun = true; this.processAndScheduleNext(); }