Skip to content

Commit

Permalink
feat : 알림 이벤트 비동기 전송
Browse files Browse the repository at this point in the history
  • Loading branch information
NHclub committed Aug 28, 2023
2 parents 6935822 + eea746b commit 4cacf81
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class BidService {
private final SseService sseService;

private final static ExecutorService executorService = Executors.newSingleThreadExecutor();
private final static ExecutorService noticeExecutorService = Executors.newSingleThreadExecutor();
private static long end_time= 0L;

@Transactional
Expand All @@ -59,7 +60,8 @@ public void createBid(Long ideaId, Long userId, BidRequest request) {
// sseService.send(SseConnect.BID, SseEvent.BID_PRICE_UPDATE,ideaId,newBid.getBidPrice());
executorService.submit(() -> sseService.send(SseConnect.BID,SseEvent.BID_PRICE_UPDATE,ideaId,newBid.getBidPrice()));
long point_six = System.currentTimeMillis();
noticeService.noticeBidEvent(userId, idea, request.bidPrice());
noticeExecutorService.submit(() -> noticeService.noticeBidEvent(userId, idea, request.bidPrice()));
// noticeService.noticeBidEvent(userId, idea, request.bidPrice());
long point_seven = System.currentTimeMillis();

point_one = end_time == 0L ? point_one : end_time;
Expand Down

0 comments on commit 4cacf81

Please sign in to comment.