Skip to content

Commit

Permalink
feature(CSVImport): Moves the CSV Import event to the start of proces…
Browse files Browse the repository at this point in the history
…sing
  • Loading branch information
KevSanchez committed Apr 16, 2024
1 parent fe9087c commit 8d1e8b6
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export class FeatureAmountUploadService {
await apiQueryRunner.startTransaction();
await geoQueryRunner.startTransaction();

await this.events.submittedEvent(data.projectId, data);

let newFeaturesFromCsvUpload;
try {
this.logger.log(
Expand Down Expand Up @@ -151,14 +153,11 @@ export class FeatureAmountUploadService {
await apiQueryRunner.commitTransaction();
await geoQueryRunner.commitTransaction();

// This is done, for now, in order to avoid unnecessary polling from FE
await this.events.submittedEvent(data.projectId, data);
await this.events.finishEvent(data.projectId);
} catch (err) {
await apiQueryRunner.rollbackTransaction();
await geoQueryRunner.rollbackTransaction();
// This is done, for now, in order to avoid unnecessary polling from FE
await this.events.submittedEvent(data.projectId, data);

await this.events.failEvent(data.projectId, err);

this.logger.error(
Expand Down

0 comments on commit 8d1e8b6

Please sign in to comment.