Merge branch 'develop' of https://github.com/alibaba/nacos into feature_consistency
This commit is contained in:
commit
586838e0a0
@ -314,12 +314,14 @@ public class HostReactor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
long delayTime = -1;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ServiceInfo serviceObj = serviceInfoMap.get(ServiceInfo.getKey(serviceName, clusters));
|
ServiceInfo serviceObj = serviceInfoMap.get(ServiceInfo.getKey(serviceName, clusters));
|
||||||
|
|
||||||
if (serviceObj == null) {
|
if (serviceObj == null) {
|
||||||
updateServiceNow(serviceName, clusters);
|
updateServiceNow(serviceName, clusters);
|
||||||
executor.schedule(this, DEFAULT_DELAY, TimeUnit.MILLISECONDS);
|
delayTime = DEFAULT_DELAY;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,11 +343,15 @@ public class HostReactor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
executor.schedule(this, serviceObj.getCacheMillis(), TimeUnit.MILLISECONDS);
|
delayTime = serviceObj.getCacheMillis();
|
||||||
|
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
NAMING_LOGGER.warn("[NA] failed to update serviceName: " + serviceName, e);
|
NAMING_LOGGER.warn("[NA] failed to update serviceName: " + serviceName, e);
|
||||||
|
} finally {
|
||||||
|
if (delayTime > 0) {
|
||||||
|
executor.schedule(this, delayTime, TimeUnit.MILLISECONDS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user