formant code
This commit is contained in:
parent
850223580a
commit
1566cdcd95
@ -36,9 +36,9 @@ import static com.alibaba.nacos.client.utils.LogUtils.NAMING_LOGGER;
|
|||||||
*/
|
*/
|
||||||
public class HostReactor {
|
public class HostReactor {
|
||||||
|
|
||||||
public static final long DEFAULT_DELAY = 1000L;
|
private static final long DEFAULT_DELAY = 1000L;
|
||||||
|
|
||||||
public long updateHoldInterval = 5000L;
|
private static final long UPDATE_HOLD_INTERVAL = 5000L;
|
||||||
|
|
||||||
private final Map<String, ScheduledFuture<?>> futureMap = new HashMap<String, ScheduledFuture<?>>();
|
private final Map<String, ScheduledFuture<?>> futureMap = new HashMap<String, ScheduledFuture<?>>();
|
||||||
|
|
||||||
@ -234,11 +234,11 @@ public class HostReactor {
|
|||||||
|
|
||||||
} else if (updatingMap.containsKey(serviceName)) {
|
} else if (updatingMap.containsKey(serviceName)) {
|
||||||
|
|
||||||
if (updateHoldInterval > 0) {
|
if (UPDATE_HOLD_INTERVAL > 0) {
|
||||||
// hold a moment waiting for update finish
|
// hold a moment waiting for update finish
|
||||||
synchronized (serviceObj) {
|
synchronized (serviceObj) {
|
||||||
try {
|
try {
|
||||||
serviceObj.wait(updateHoldInterval);
|
serviceObj.wait(UPDATE_HOLD_INTERVAL);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
NAMING_LOGGER.error("[getServiceInfo] serviceName:" + serviceName + ", clusters:" + clusters, e);
|
NAMING_LOGGER.error("[getServiceInfo] serviceName:" + serviceName + ", clusters:" + clusters, e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user