Skip to content

Commit

Permalink
Merge pull request #90 from SWM-M3PRO/develop
Browse files Browse the repository at this point in the history
Hot Fix : 픽셀 점령 시 로그 추가, 리버스 지오코딩이 되지 않아도 점령되게 수정
  • Loading branch information
koomin1227 authored Oct 8, 2024
2 parents 1135869 + fad822c commit 1c9d23d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/com/m3pro/groundflip/service/PixelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public void occupyPixelWithLock(PixelOccupyRequest pixelOccupyRequest) {
private void occupyPixel(PixelOccupyRequest pixelOccupyRequest) {
Long occupyingUserId = pixelOccupyRequest.getUserId();
Long occupyingCommunityId = Optional.ofNullable(pixelOccupyRequest.getCommunityId()).orElse(-1L);
log.info("[Visit Pixel] x : {}, y: {}, user : {}", pixelOccupyRequest.getX(), pixelOccupyRequest.getY(),
occupyingUserId);

if (!isValidCoordinate(pixelOccupyRequest.getX(), pixelOccupyRequest.getY())) {
throw new AppException(ErrorCode.PIXEL_NOT_FOUND);
Expand Down Expand Up @@ -143,7 +145,13 @@ private Pixel createPixel(Long x, Long y) {
private ReverseGeocodingResult getRegion(Point coordinate) {
double longitude = coordinate.getX();
double latitude = coordinate.getY();
return reverseGeoCodingService.getRegionFromCoordinates(longitude, latitude);
try {
return reverseGeoCodingService.getRegionFromCoordinates(longitude, latitude);
} catch (Exception e) {
String errorLog = "[Reverse Geocoding Error] longitude : " + longitude + ", latitude : " + latitude + " ";
log.error("{}{}", errorLog, e.getMessage(), e);
return ReverseGeocodingResult.builder().regionId(null).regionName(null).build();
}
}

private Point getCoordinate(Long x, Long y) {
Expand Down

0 comments on commit 1c9d23d

Please sign in to comment.