Skip to content

Commit

Permalink
[INLONG-10470][Audit] Modify default value
Browse files Browse the repository at this point in the history
  • Loading branch information
doleyzi committed Jun 20, 2024
1 parent f0055e3 commit 249e006
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ public void setManagerTimeout(int timeoutMs) {
ProxyManager.getInstance().setManagerTimeout(timeoutMs);
}

public void setAutoUpdateAuditProxy(boolean autoUpdateAuditProxy) {
ProxyManager.getInstance().setAutoUpdateAuditProxy(autoUpdateAuditProxy);
public void setAutoUpdateAuditProxy() {
ProxyManager.getInstance().setAutoUpdateAuditProxy();
}

public void setUpdateInterval(int updateInterval) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class ProxyManager {
private String secretKey;
private volatile boolean timerStarted = false;
private static final int MAX_RETRY_TIMES = 1440;
private static final int RETRY_INTERVAL_MS = 1000;
private static final int RETRY_INTERVAL_MS = 10000;

private ProxyManager() {
}
Expand Down Expand Up @@ -84,11 +84,6 @@ public synchronized void setManagerConfig(AuditComponent component, String manag
this.secretKey = secretKey;

retryAsync();

if (autoUpdateAuditProxy) {
startTimer();
LOGGER.info("Auto update from manager");
}
}

private void retryAsync() {
Expand Down Expand Up @@ -141,7 +136,7 @@ private synchronized void startTimer() {
return;
}
timer.scheduleWithFixedDelay(this::updateAuditProxy,
0,
updateInterval,
updateInterval,
TimeUnit.MILLISECONDS);
timerStarted = true;
Expand All @@ -151,8 +146,9 @@ public void setManagerTimeout(int timeoutMs) {
this.timeoutMs = timeoutMs;
}

public void setAutoUpdateAuditProxy(boolean autoUpdateAuditProxy) {
this.autoUpdateAuditProxy = autoUpdateAuditProxy;
public void setAutoUpdateAuditProxy() {
startTimer();
LOGGER.info("Auto update Audit Proxy info from manager");
}

public void setUpdateInterval(int updateInterval) {
Expand Down

0 comments on commit 249e006

Please sign in to comment.