From c81be11acc495b5781f54eb60e75cced9247225c Mon Sep 17 00:00:00 2001 From: andrea rota Date: Thu, 7 Mar 2024 23:01:28 +0000 Subject: [PATCH 1/2] bypass obsolete saga --- .../move-data-from-preparation.handler.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/api/apps/api/src/modules/scenarios-features/move-data-from-preparation.handler.ts b/api/apps/api/src/modules/scenarios-features/move-data-from-preparation.handler.ts index fbab052a8f..96202b98ff 100644 --- a/api/apps/api/src/modules/scenarios-features/move-data-from-preparation.handler.ts +++ b/api/apps/api/src/modules/scenarios-features/move-data-from-preparation.handler.ts @@ -69,12 +69,5 @@ export class MoveDataFromPreparationHandler specificationId: command.specificationId, }); }); - - this.eventBus.publish( - new DataMovedFormPreparationEvent( - command.scenarioId, - command.specificationId, - ), - ); } } From 70662ea5ed8336881c693bce649dd1f11064b915 Mon Sep 17 00:00:00 2001 From: andrea rota Date: Thu, 7 Mar 2024 23:03:00 +0000 Subject: [PATCH 2/2] only bypass obsolete (and expensive) query The rest of the flow is still needed to finish triggering completion events, until we refactor this more cleanly. --- .../move-data-from-preparation.handler.ts | 7 +++++++ ...scenario-planning-units-features-aggregate-processor.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/api/apps/api/src/modules/scenarios-features/move-data-from-preparation.handler.ts b/api/apps/api/src/modules/scenarios-features/move-data-from-preparation.handler.ts index 96202b98ff..fbab052a8f 100644 --- a/api/apps/api/src/modules/scenarios-features/move-data-from-preparation.handler.ts +++ b/api/apps/api/src/modules/scenarios-features/move-data-from-preparation.handler.ts @@ -69,5 +69,12 @@ export class MoveDataFromPreparationHandler specificationId: command.specificationId, }); }); + + this.eventBus.publish( + new DataMovedFormPreparationEvent( + command.scenarioId, + command.specificationId, + ), + ); } } diff --git a/api/apps/geoprocessing/src/modules/scenario-planning-units-features-aggregate/scenario-planning-units-features-aggregate-processor.ts b/api/apps/geoprocessing/src/modules/scenario-planning-units-features-aggregate/scenario-planning-units-features-aggregate-processor.ts index ac2c3c5f7d..fb8e588925 100644 --- a/api/apps/geoprocessing/src/modules/scenario-planning-units-features-aggregate/scenario-planning-units-features-aggregate-processor.ts +++ b/api/apps/geoprocessing/src/modules/scenario-planning-units-features-aggregate/scenario-planning-units-features-aggregate-processor.ts @@ -44,6 +44,13 @@ export class ScenarioPlanningUnitsFeaturesAggregateProcessor ) {} async process(job: Job): Promise { + /** + * @debt Bypassing the original query, whose results are not needed anymore, + * and which was expensive to run. The flow that includes this processor + * should be cleaned up instead, to fully bypass + * ScenarioPlanningUnitsFeaturesAggregateProcessor. + */ + return true; const scenarioId = job.data.scenarioId; await this.entityManager.query(query, [scenarioId]); return true;