main
黄海 7 months ago
parent b0651a3a16
commit 03f321d5db

@ -13,7 +13,7 @@ public class Util {
* @param url URL
* @return
*/
public static String doGet(String url) {
public static String doGet(String url) throws InterruptedException {
int retries = 3;
while (retries > 0) {
try {
@ -24,6 +24,7 @@ public class Util {
} catch (Exception e) {
System.out.println("调用失败,正在重试!");
System.out.println(e);
Thread.sleep(1000);
retries--;
if (retries == 0) {
throw new RuntimeException("请求失败已重试3次", e);

Loading…
Cancel
Save