Skip to content

Commit

Permalink
Merge pull request #300 from zipdabang/refactor/296
Browse files Browse the repository at this point in the history
♻️  Refactor/296 thread 순서 체크 위한 log 추가(parallelStream)
  • Loading branch information
Hanvp authored Feb 3, 2024
2 parents b7bca8c + 65bd4f1 commit 1d68317
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/zipdabang/server/converter/RecipeConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ public static TestRecipe toTestRecipe(RecipeRequestDto.CreateRecipeDto request,
}

public static List<TestRecipeCategoryMapping> toTestRecipeCategory(List<Long> categoryIds, TestRecipe recipe) {
return categoryIds.stream()
return categoryIds.stream().parallel()
.map(recipeCategoryId -> toTestRecipeCategoryMappingDto(recipeCategoryId, recipe))
.collect(Collectors.toList());
}
Expand All @@ -761,7 +761,7 @@ private static TestRecipeCategoryMapping toTestRecipeCategoryMappingDto(Long cat
}

public static List<TestStep> toTestStep(RecipeRequestDto.CreateRecipeDto request, TestRecipe recipe, List<MultipartFile> stepImages) {
return request.getSteps().stream()
return request.getSteps().stream().parallel()
.map(step-> {
if (step.getDescription() == null)
throw new RecipeException(CommonStatus.NULL_RECIPE_ERROR);
Expand Down Expand Up @@ -804,7 +804,7 @@ private static TestStep toTestStepDto(RecipeRequestDto.StepDto step, TestRecipe
}

public static List<TestIngredient> toTestIngredient(RecipeRequestDto.CreateRecipeDto request, TestRecipe recipe) {
return request.getIngredients().stream()
return request.getIngredients().stream().parallel()
.map(ingredient -> toTestIngredientDto(ingredient, recipe))
.collect(Collectors.toList());
}
Expand Down

0 comments on commit 1d68317

Please sign in to comment.