Skip to content

Commit

Permalink
#129 refactor: 별도 메소드 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
yonghwankim-dev committed Jan 12, 2024
1 parent 0e171c7 commit 75f5d5d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public void startProcessing() {

public void sendEventToPortfolio(LocalDateTime eventDatetime) {
log.info("sseEmitter 개수 : {}", manager.size());
publishPortfolioEvent(eventDatetime);
this.executor.schedule(() -> this.sendEventToPortfolio(LocalDateTime.now()), 5, SECONDS);
}

public void publishPortfolioEvent(LocalDateTime eventDatetime) {
List<Long> deadEmitters = new ArrayList<>();
for (Long id : manager.keys()) {
try {
Expand All @@ -51,6 +56,5 @@ public void sendEventToPortfolio(LocalDateTime eventDatetime) {
}
}
deadEmitters.forEach(manager::remove);
this.executor.schedule(() -> this.sendEventToPortfolio(LocalDateTime.now()), 5, SECONDS);
}
}

0 comments on commit 75f5d5d

Please sign in to comment.