Skip to content

Commit

Permalink
spring-projectsGH-388: add non blocking sleeper
Browse files Browse the repository at this point in the history
- fix (spring-projects#388)
- add non blocking sleeper
  • Loading branch information
Alireza Hakimrabet committed May 24, 2024
1 parent 6b07318 commit eb6caae
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public void sleep(long backOffPeriod) throws InterruptedException {
try {
TimeUnit.MILLISECONDS.sleep(backOffPeriod);
}
catch (InterruptedException e) {
catch (Exception e) {
Thread.currentThread().interrupt();
throw new RuntimeException("Unexpected exception", e);
throw new BackOffInterruptedException("Thread interrupted while sleeping", e);
}
});
future.join();
Expand Down

0 comments on commit eb6caae

Please sign in to comment.