Skip to content

Commit

Permalink
Merge pull request #30 from FinalDoubleTen/BE-68-Async-Trip-Path
Browse files Browse the repository at this point in the history
Refactor : 경로 관련 동시성 이슈 해결
  • Loading branch information
kdjun99 authored Jan 11, 2024
2 parents bc78467 + 43b20e5 commit f642921
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@Component
@RequiredArgsConstructor
Expand All @@ -23,7 +24,7 @@ public class PathComponent {
public TripPathCalculationResult getTripPath(List<TripPlace> tripPlaceList) {
List<PathCalculateRequest> pathCalculateRequests = toPathCalculateRequest(tripPlaceList);
Integer priceSum = 0;
List<TripPathInfoMsg> pathInfoMsgs = new ArrayList<>();
List<TripPathInfoMsg> pathInfoMsgs = new CopyOnWriteArrayList<>();
for (PathCalculateRequest calculateRequest : pathCalculateRequests) {
asyncPathComponent.calculatePath(calculateRequest.from(), calculateRequest.to(), pathInfoMsgs);
}
Expand Down

0 comments on commit f642921

Please sign in to comment.