mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Merge branch '2.7.x'
Closes gh-33852
This commit is contained in:
commit
522ef881a0
@ -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;
|
||||
@ -53,14 +54,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<Map> response = this.rest.postForEntity("issues", requestBody, Map.class);
|
||||
// See gh-30304
|
||||
sleep(Duration.ofSeconds(3));
|
||||
return (Integer) response.getBody().get("number");
|
||||
}
|
||||
catch (RestClientException ex) {
|
||||
@ -96,4 +93,13 @@ final class StandardGitHubRepository implements GitHubRepository {
|
||||
return ((List<Map<String, Object>>) response.getBody()).stream().map(mapper).toList();
|
||||
}
|
||||
|
||||
private static void sleep(Duration duration) {
|
||||
try {
|
||||
Thread.sleep(duration.toMillis());
|
||||
}
|
||||
catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user