Skip to content

Commit

Permalink
네이버 gc 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
HyungJu committed Sep 24, 2024
1 parent 374dae1 commit fed0246
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class NaverGcService(
val body = it.responseBody
val response = objectMapper.readValue<ApiResponse>(body)


if (response.status.code == 3) {
return@thenApply null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class PhotoBookService(
input: CreatePhotobookRequest,
): PhotoBook {
val photos: MutableList<Photo> = mutableListOf()
val chunkSize = 30
val chunkSize = 20
val photoChunks = input.photos.chunked(chunkSize)

photoChunks.parallelStream().forEach { chunk ->
chunk.forEach { photo ->
photoChunks.forEach { chunk ->
chunk.parallelStream().forEach { photo ->
naverGcService.getLocation(photo.toGetLocationInputDto()).thenApply {
photos.add(
Photo(
Expand All @@ -63,7 +63,7 @@ class PhotoBookService(
}

val filteredPhoto = photos.filter {
it.location?.city == "경기도"
it.location?.city == "경기도" || it.location?.city?.contains("경기") == true
}

val photoBook =
Expand Down

0 comments on commit fed0246

Please sign in to comment.