Skip to content

Commit

Permalink
[Mission] fix duplicate mission
Browse files Browse the repository at this point in the history
  • Loading branch information
claire2212 committed Jan 23, 2025
1 parent c0e6824 commit aeba475
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ class CreateOrUpdateMission(

val normalizedMission =
mission.geom?.let { nonNullGeom ->
mission.copy(geom = postgisFunctionRepository.normalizeMultipolygon(nonNullGeom))
} ?: mission
mission.copy(
geom = postgisFunctionRepository.normalizeMultipolygon(nonNullGeom),
)
}
?: mission

val facade =
normalizedMission.geom?.let { nonNullGeom ->
Expand All @@ -47,9 +50,14 @@ class CreateOrUpdateMission(
}

logger.info("Sending CREATE/UPDATE event for mission id ${savedMission.mission.id}.")
eventPublisher.publishEvent(
UpdateMissionEvent(savedMission.mission),
)

try {
eventPublisher.publishEvent(
UpdateMissionEvent(savedMission.mission),
)
} catch (e: Exception) {
logger.warn("Failed to send event for mission id ${savedMission.mission.id}.", e)
}

return savedMission.mission
}
Expand Down

0 comments on commit aeba475

Please sign in to comment.