Skip to content

Commit af2b5b4

Browse files
committed
Increase sleep duration after creating GitHib issue in BOMR
Closes gh-30304
1 parent 9f2ed20 commit af2b5b4

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.HashSet;
2122
import java.util.List;
@@ -54,14 +55,10 @@ public int openIssue(String title, String body, List<String> labels, Milestone m
5455
requestBody.put("labels", labels);
5556
}
5657
requestBody.put("body", body);
57-
try {
58-
Thread.sleep(1000);
59-
}
60-
catch (InterruptedException ex) {
61-
Thread.currentThread().interrupt();
62-
}
6358
try {
6459
ResponseEntity<Map> response = this.rest.postForEntity("issues", requestBody, Map.class);
60+
// See gh-30304
61+
sleep(Duration.ofSeconds(3));
6562
return (Integer) response.getBody().get("number");
6663
}
6764
catch (RestClientException ex) {
@@ -98,4 +95,13 @@ private <T> List<T> get(String name, Function<Map<String, Object>, T> mapper) {
9895
return body.stream().map(mapper).collect(Collectors.toList());
9996
}
10097

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

0 commit comments

Comments
 (0)