From 0211f78cbf8dd5dcfde3ad89ef2bf568ad184d5e Mon Sep 17 00:00:00 2001 From: JunYong Sun Date: Mon, 22 Jan 2024 03:01:36 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20=EB=82=98=EB=A8=B8=EC=A7=80=20=EC=9E=85?= =?UTF-8?q?=EC=B0=B0=EC=9E=90=EB=93=A4=20=EB=82=B4=EC=97=AD=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dailyon/auctionservice/facade/BidFacade.java | 1 - .../dailyon/auctionservice/service/BidService.java | 12 ++++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/dailyon/auctionservice/facade/BidFacade.java b/src/main/java/com/dailyon/auctionservice/facade/BidFacade.java index eb5f642..6655fb8 100644 --- a/src/main/java/com/dailyon/auctionservice/facade/BidFacade.java +++ b/src/main/java/com/dailyon/auctionservice/facade/BidFacade.java @@ -47,7 +47,6 @@ public Mono start(String auctionId) { .startAuction(auctionId) .flatMap( auction -> { - log.info("startAuction", auction.getStartAt()); scheduler.startJob(auctionId); return chatHandler.broadCastStart(payload); }); diff --git a/src/main/java/com/dailyon/auctionservice/service/BidService.java b/src/main/java/com/dailyon/auctionservice/service/BidService.java index ff51a61..cde4bb5 100644 --- a/src/main/java/com/dailyon/auctionservice/service/BidService.java +++ b/src/main/java/com/dailyon/auctionservice/service/BidService.java @@ -80,9 +80,8 @@ private Mono processAuction(Auction auction, Long bid) { Mono productInfo = productClient.readProductDetail(auction.getAuctionProductId()); - return Mono.zip( - saveSuccessfulBiddersHistory(productInfo, auction, bid), - saveRemainBiddersHistory(productInfo, auction, bid)) + return saveSuccessfulBiddersHistory(productInfo, auction, bid) + .then(saveRemainBiddersHistory(productInfo, auction, bid)) .then(sendSqsNotification(auction)); } @@ -119,7 +118,11 @@ private Mono saveRemainBiddersHistory( .zipWith(Mono.just(bid)) .flatMapMany( tuple -> createAuctionHistories(auction, tuple.getT1(), tuple.getT2(), false)); - return saveAuctionHistories(auctionHistories).then(auctionHistories.collectList()).then(); + + return auctionHistories + .collectList() + .flatMap(list -> saveAuctionHistories(Flux.fromIterable(list))) + .then(); } private Mono sendSqsNotification(Auction auction) { @@ -153,6 +156,7 @@ private Flux createAuctionHistories( return bidders.map( tuple -> { BidInfo value = tuple.getValue(); + log.info("asdasd {} :", tuple.getValue().getMemberId()); return value.createAuctionHistory( auction, product, tuple.getScore().longValue(), auctionWinnerBid, isSuccessful); });