Merge branch '2.5.x' into 2.6.x

2.6.x
Andy Wilkinson 2 years ago
commit 33a339b462

@ -16,6 +16,7 @@
package org.springframework.boot.build.bom.bomr.github; package org.springframework.boot.build.bom.bomr.github;
import java.time.Duration;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -52,14 +53,10 @@ final class StandardGitHubRepository implements GitHubRepository {
requestBody.put("labels", labels); requestBody.put("labels", labels);
} }
requestBody.put("body", body); requestBody.put("body", body);
try {
Thread.sleep(1000);
}
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
try { try {
ResponseEntity<Map> response = this.rest.postForEntity("issues", requestBody, Map.class); ResponseEntity<Map> response = this.rest.postForEntity("issues", requestBody, Map.class);
// See gh-30304
sleep(Duration.ofSeconds(3));
return (Integer) response.getBody().get("number"); return (Integer) response.getBody().get("number");
} }
catch (RestClientException ex) { catch (RestClientException ex) {
@ -96,4 +93,13 @@ final class StandardGitHubRepository implements GitHubRepository {
return body.stream().map(mapper).collect(Collectors.toList()); 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();
}
}
} }

Loading…
Cancel
Save