Skip to content

Commit

Permalink
fix:Change the time interval to seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
youngzil committed Oct 14, 2024
1 parent 103a040 commit 06339a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ public void run() {

if (refreshSuccess) {
refreshServiceAddressService
.schedule(new RefreshAdminServerAddressTask(), portalConfig.refreshAdminServerAddressTaskNormalIntervalInMilli(), TimeUnit.MILLISECONDS);
.schedule(new RefreshAdminServerAddressTask(), portalConfig.refreshAdminServerAddressTaskNormalIntervalSecond(), TimeUnit.SECONDS);
} else {
refreshServiceAddressService
.schedule(new RefreshAdminServerAddressTask(), portalConfig.refreshAdminServerAddressTaskOfflineIntervalInMilli(), TimeUnit.MILLISECONDS);
.schedule(new RefreshAdminServerAddressTask(), portalConfig.refreshAdminServerAddressTaskOfflineIntervalSecond(), TimeUnit.SECONDS);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public class PortalConfig extends RefreshableConfig {

private static final Logger logger = LoggerFactory.getLogger(PortalConfig.class);

private static final int DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_NORMAL_INTERVAL_IN_MILLI = 5 * 60 * 1000; //5min
private static final int DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_OFFLINE_INTERVAL_IN_MILLI = 10 * 1000; //10s
private static final int DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_NORMAL_INTERVAL_IN_SECOND = 5 * 60; //5min
private static final int DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_OFFLINE_INTERVAL_IN_SECOND = 10; //10s

private static final Gson GSON = new Gson();
private static final Type ORGANIZATION = new TypeToken<List<Organization>>() {
Expand Down Expand Up @@ -196,14 +196,14 @@ public String portalAddress() {
return getValue("apollo.portal.address");
}

public int refreshAdminServerAddressTaskNormalIntervalInMilli() {
int interval = getIntProperty("refresh.admin.server.address.task.normal.interval.ms", DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_NORMAL_INTERVAL_IN_MILLI);
return checkInt(interval, 5, Integer.MAX_VALUE, DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_NORMAL_INTERVAL_IN_MILLI);
public int refreshAdminServerAddressTaskNormalIntervalSecond() {
int interval = getIntProperty("refresh.admin.server.address.task.normal.interval.second", DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_NORMAL_INTERVAL_IN_SECOND);
return checkInt(interval, 5, Integer.MAX_VALUE, DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_NORMAL_INTERVAL_IN_SECOND);
}

public int refreshAdminServerAddressTaskOfflineIntervalInMilli() {
int interval = getIntProperty("refresh.admin.server.address.task.offline.interval.ms", DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_OFFLINE_INTERVAL_IN_MILLI);
return checkInt(interval, 5, Integer.MAX_VALUE, DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_OFFLINE_INTERVAL_IN_MILLI);
public int refreshAdminServerAddressTaskOfflineIntervalSecond() {
int interval = getIntProperty("refresh.admin.server.address.task.offline.interval.second", DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_OFFLINE_INTERVAL_IN_SECOND);
return checkInt(interval, 5, Integer.MAX_VALUE, DEFAULT_REFRESH_ADMIN_SERVER_ADDRESS_TASK_OFFLINE_INTERVAL_IN_SECOND);
}

public boolean isEmergencyPublishAllowed(Env env) {
Expand Down

0 comments on commit 06339a6

Please sign in to comment.