Skip to content

Commit

Permalink
update log for UpstreamRedisClientTemplateFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
caojiajun committed Feb 13, 2023
1 parent cc4f67a commit a4bda7e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ private void initCustom() {
private UpstreamRedisClientTemplate initCustomInstance(long bid, String bgroup) {
CamelliaTranspondProperties.CustomProperties custom = properties.getCustom();
if (custom == null) return null;
logger.info("UpstreamRedisClientTemplate init, bid = {}, bgroup = {}", bid, bgroup);
UpstreamRedisClientTemplate template = new UpstreamRedisClientTemplate(env, bid, bgroup, updater, custom.getReloadIntervalMillis());
//更新的callback
ResourceTableUpdateCallback updateCallback = template::update;
Expand All @@ -259,7 +260,6 @@ private UpstreamRedisClientTemplate initCustomInstance(long bid, String bgroup)
};
//添加callback
updater.addCallback(bid, bgroup, updateCallback, removeCallback);
logger.info("UpstreamRedisClientTemplate init, bid = {}, bgroup = {}", bid, bgroup);
return template;
}

Expand All @@ -269,9 +269,8 @@ private UpstreamRedisClientTemplate initRemoteInstance(long bid, String bgroup)
if (remote == null) return null;
boolean monitorEnable = remote.isMonitorEnable();
long checkIntervalMillis = remote.getCheckIntervalMillis();
UpstreamRedisClientTemplate template = new UpstreamRedisClientTemplate(env, apiService, bid, bgroup, monitorEnable, checkIntervalMillis);
logger.info("UpstreamRedisClientTemplate init, bid = {}, bgroup = {}", bid, bgroup);
return template;
return new UpstreamRedisClientTemplate(env, apiService, bid, bgroup, monitorEnable, checkIntervalMillis);
}

private void initEnv() {
Expand Down

0 comments on commit a4bda7e

Please sign in to comment.