aloyszhang commented on code in PR #10398:
URL: https://github.com/apache/inlong/pull/10398#discussion_r1637810471
##########
inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/send/ProxyManager.java:
##########
@@ -42,13 +60,77 @@ public static ProxyManager getInstance() {
/**
* update config
*/
- public void setAuditProxy(HashSet<String> ipPortList) {
+ public synchronized void setAuditProxy(HashSet<String> ipPortList) {
if (!ipPortList.equals(new HashSet<>(currentIpPorts))) {
currentIpPorts.clear();
currentIpPorts.addAll(ipPortList);
}
}
+ public synchronized void setManagerConfig(AuditComponent component, String
managerHost, AuthConfig authConfig) {
+ if (!managerHost.endsWith("/")) {
+ managerHost = managerHost + "/";
+ }
+ if (!(managerHost.startsWith("http://") ||
managerHost.startsWith("https://"))) {
+ managerHost = "http://" + managerHost;
+ }
+ auditProxyApiUrl = String.format("%s%s", managerHost,
GET_AUDIT_PROXY_API_PATH);
+ LOGGER.info("Audit Proxy API URL: {}", auditProxyApiUrl);
+
+ this.authConfig = authConfig;
+ this.component = component;
+
+ updateAuditProxy();
+
+ if (autoUpdateAuditProxy) {
+ startTimer();
+ LOGGER.info("Auto Update from manager");
Review Comment:
```suggestion
LOGGER.info("Auto update from manager");
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]