From db6883aef61801d0aae56663dfa06a121cb06948 Mon Sep 17 00:00:00 2001 From: Hanvp Date: Sat, 3 Feb 2024 23:53:50 +0900 Subject: [PATCH] =?UTF-8?q?:recycle:=20Refactor/296-async=20thread=20?= =?UTF-8?q?=EC=88=9C=EC=84=9C=20=EC=B2=B4=ED=81=AC=20=EC=9C=84=ED=95=9C=20?= =?UTF-8?q?log=20=EC=B6=94=EA=B0=80(@Async+parallelStream)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/zipdabang/server/converter/RecipeConverter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/zipdabang/server/converter/RecipeConverter.java b/src/main/java/zipdabang/server/converter/RecipeConverter.java index 95cebfe..977f613 100644 --- a/src/main/java/zipdabang/server/converter/RecipeConverter.java +++ b/src/main/java/zipdabang/server/converter/RecipeConverter.java @@ -748,7 +748,7 @@ public static TestRecipe toTestRecipe(RecipeRequestDto.CreateRecipeDto request, } public static CompletableFuture> toTestRecipeCategory(List categoryIds, TestRecipe recipe) { - return CompletableFuture.completedFuture(categoryIds.stream() + return CompletableFuture.completedFuture(categoryIds.stream().parallel() .map(recipeCategoryId -> toTestRecipeCategoryMappingDto(recipeCategoryId, recipe)) .collect(Collectors.toList())); } @@ -762,7 +762,7 @@ private static TestRecipeCategoryMapping toTestRecipeCategoryMappingDto(Long cat } public static CompletableFuture> toTestStep(RecipeRequestDto.CreateRecipeDto request, TestRecipe recipe, List stepImages) { - return CompletableFuture.completedFuture(request.getSteps().stream() + return CompletableFuture.completedFuture(request.getSteps().stream().parallel() .map(step-> { if (step.getDescription() == null) throw new RecipeException(CommonStatus.NULL_RECIPE_ERROR); @@ -806,7 +806,7 @@ private static TestStep toTestStepDto(RecipeRequestDto.StepDto step, TestRecipe } public static CompletableFuture> toTestIngredient(RecipeRequestDto.CreateRecipeDto request, TestRecipe recipe) { - return CompletableFuture.completedFuture(request.getIngredients().stream() + return CompletableFuture.completedFuture(request.getIngredients().stream().parallel() .map(ingredient -> toTestIngredientDto(ingredient, recipe)) .collect(Collectors.toList())); }