diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java index e7d0b6a681..2a15f1ecb2 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java @@ -16,6 +16,7 @@ package org.springframework.boot.build.bom.bomr.github; +import java.time.Duration; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -54,14 +55,10 @@ final class StandardGitHubRepository implements GitHubRepository { requestBody.put("labels", labels); } requestBody.put("body", body); - try { - Thread.sleep(1000); - } - catch (InterruptedException ex) { - Thread.currentThread().interrupt(); - } try { ResponseEntity response = this.rest.postForEntity("issues", requestBody, Map.class); + // See gh-30304 + sleep(Duration.ofSeconds(3)); return (Integer) response.getBody().get("number"); } catch (RestClientException ex) { @@ -98,4 +95,13 @@ final class StandardGitHubRepository implements GitHubRepository { return body.stream().map(mapper).collect(Collectors.toList()); } + private static void sleep(Duration duration) { + try { + Thread.sleep(duration.toMillis()); + } + catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } + } + }