Skip to content

Commit 33a339b

Browse files
committed
Merge branch '2.5.x' into 2.6.x
2 parents 95d1cb9 + 038ec07 commit 33a339b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.boot.build.bom.bomr.github;
1818

19+
import java.time.Duration;
1920
import java.util.HashMap;
2021
import java.util.List;
2122
import java.util.Map;
@@ -52,14 +53,10 @@ public int openIssue(String title, String body, List<String> labels, Milestone m
5253
requestBody.put("labels", labels);
5354
}
5455
requestBody.put("body", body);
55-
try {
56-
Thread.sleep(1000);
57-
}
58-
catch (InterruptedException ex) {
59-
Thread.currentThread().interrupt();
60-
}
6156
try {
6257
ResponseEntity<Map> response = this.rest.postForEntity("issues", requestBody, Map.class);
58+
// See gh-30304
59+
sleep(Duration.ofSeconds(3));
6360
return (Integer) response.getBody().get("number");
6461
}
6562
catch (RestClientException ex) {
@@ -96,4 +93,13 @@ private <T> List<T> get(String name, Function<Map<String, Object>, T> mapper) {
9693
return body.stream().map(mapper).collect(Collectors.toList());
9794
}
9895

96+
private static void sleep(Duration duration) {
97+
try {
98+
Thread.sleep(duration.toMillis());
99+
}
100+
catch (InterruptedException ex) {
101+
Thread.currentThread().interrupt();
102+
}
103+
}
104+
99105
}

0 commit comments

Comments
 (0)