feat:Early method return (#823)

pull/835/head
WuLang 2 years ago committed by GitHub
parent 76a4f16953
commit 1ad8aabe8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -154,6 +154,9 @@ public class ClientWorker {
}
public List<String> checkUpdateTpIds(String probeUpdateString, boolean isInitializingCacheList) {
if (StringUtils.isEmpty(probeUpdateString)) {
return Collections.emptyList();
}
Map<String, String> params = new HashMap(2);
params.put(PROBE_MODIFY_REQUEST, probeUpdateString);
params.put(WEIGHT_CONFIGS, IdUtil.simpleUUID());
@ -165,9 +168,6 @@ public class ClientWorker {
if (isInitializingCacheList) {
headers.put(LONG_PULLING_TIMEOUT_NO_HANGUP, "true");
}
if (StringUtils.isEmpty(probeUpdateString)) {
return Collections.emptyList();
}
try {
long readTimeoutMs = timeout + (long) Math.round(timeout >> 1);
Result result = agent.httpPostByConfig(LISTENER_PATH, headers, params, readTimeoutMs);

Loading…
Cancel
Save