Skip to content

Commit

Permalink
refactor: retry 횟수를 상수로 뺀다
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb committed Jan 10, 2024
1 parent 34db10e commit c3ae0d8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
@RequiredArgsConstructor
public class GptInterestQuestion implements InterestQuestion {

private static final int MAX_RETRY_COUNT = 5;

private final WebClient webClient;
private final ObjectMapper objectMapper;
private final ExecutorService executorService = Executors.newCachedThreadPool();
Expand All @@ -43,7 +45,7 @@ public InterestQuestionResponse getQuestion(List<User> users) {
}
return response.createError();
})
.retry(5)
.retry(MAX_RETRY_COUNT)
.subscribeOn(Schedulers.fromExecutor(executorService))
.block(Duration.ofSeconds(5));
}
Expand Down

0 comments on commit c3ae0d8

Please sign in to comment.