Skip to content

Commit

Permalink
Revert "chore: troubleshooting logs"
Browse files Browse the repository at this point in the history
This reverts commit 2db94cd.
  • Loading branch information
jyoo0515 committed Nov 7, 2024
1 parent 2db94cd commit 0a87f0d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class PlaceApplicationService(
}
}

logger.info("Publishing place search event")
eventPublisher.publishEvent(PlaceSearchEvent(places.map(Place::toPlaceDTO)))
places
}
Expand Down Expand Up @@ -155,7 +154,6 @@ class PlaceApplicationService(
}

private fun List<Place>.mergeLocalDatabases(): List<Place> {
logger.info("Merging local databases")
val existingPlaceById = placeRepository.findAllById(this.map { it.id })
.associateBy { it.id }
return this.map { searchedPlace ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ import club.staircrusher.stdlib.di.annotation.Component
import club.staircrusher.stdlib.geography.Length
import club.staircrusher.stdlib.geography.Location
import club.staircrusher.stdlib.geography.LocationUtils
import mu.KotlinLogging

@Component
class PlaceSearchService(
private val placeApplicationService: PlaceApplicationService,
private val buildingService: BuildingService,
private val accessibilityApplicationService: AccessibilityApplicationService,
) {
private val logger = KotlinLogging.logger {}

) {
data class SearchPlacesResult(
val place: Place,
val buildingAccessibility: BuildingAccessibility?,
Expand All @@ -44,7 +42,6 @@ class PlaceSearchService(
limit: Int?,
userId: String? = null,
): List<SearchPlacesResult> {
logger.info("First place search with search options for keyword: $searchText")
val places = placeApplicationService.findAllByKeyword(
searchText,
option = MapsService.SearchByKeywordOption(
Expand All @@ -60,7 +57,6 @@ class PlaceSearchService(
),
).let {
if (it.isEmpty() && currentLocation != null) {
logger.info("Place search without options for keyword: $searchText")
// Kakao 지도 API의 경우, 최대 검색 반경이 25km밖에 되지 않는다.
// 그래서 서울에서 제주 스타벅스를 검색하는 경우 검색 결과가 안뜨는 등의 이슈가 있다.
// 이러한 문제를 우회하기 위해, 검색 결과가 없는 경우에는 currentLocation을 빼고 검색을 다시 시도해본다.
Expand All @@ -73,8 +69,6 @@ class PlaceSearchService(
}
}

logger.info("Place search result(names): ${places.map { "${it.name}(${it.id})" }}")

val placeIdToIsFavoriteMap = userId?.let { uid -> placeApplicationService.isFavoritePlaces(places.map { it.id }, uid) } ?: emptyMap()

return places.toSearchPlacesResult(currentLocation = currentLocation, placeIdToIsFavoriteMap = placeIdToIsFavoriteMap)
Expand Down

0 comments on commit 0a87f0d

Please sign in to comment.