|
@@ -6,6 +6,7 @@ import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
+import org.apache.commons.lang3.RandomUtils;
|
|
import org.springframework.boot.ApplicationArguments;
|
|
import org.springframework.boot.ApplicationArguments;
|
|
import org.springframework.boot.ApplicationRunner;
|
|
import org.springframework.boot.ApplicationRunner;
|
|
import org.springframework.core.annotation.Order;
|
|
import org.springframework.core.annotation.Order;
|
|
@@ -59,7 +60,8 @@ public class ApiStatusInfoHolder implements ApplicationRunner {
|
|
}
|
|
}
|
|
|
|
|
|
private static synchronized void refresh() {
|
|
private static synchronized void refresh() {
|
|
-
|
|
|
|
|
|
+ long trace = 10000 + RandomUtils.nextLong(0, 89999);
|
|
|
|
+ LOG.info(trace + " [ApiStatus]. refresh...");
|
|
running.set(true);
|
|
running.set(true);
|
|
try {
|
|
try {
|
|
ReportorHolder.getApiDataReportor().report();
|
|
ReportorHolder.getApiDataReportor().report();
|
|
@@ -77,10 +79,11 @@ public class ApiStatusInfoHolder implements ApplicationRunner {
|
|
apiStatusInfoMap = newApiInfoMap;
|
|
apiStatusInfoMap = newApiInfoMap;
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- LOG.error("fail to refresh API status.", e);
|
|
|
|
|
|
+ LOG.info(trace + " [ApiStatus]. fail to refresh API status", e);
|
|
}
|
|
}
|
|
Util.sleep(TimeUnit.MILLISECONDS, 500);
|
|
Util.sleep(TimeUnit.MILLISECONDS, 500);
|
|
running.set(false);
|
|
running.set(false);
|
|
|
|
+ LOG.info(trace + " [ApiStatus]. OVER");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|