Skip to content

Commit

Permalink
ut fix
Browse files Browse the repository at this point in the history
  • Loading branch information
funky-eyes committed Jan 2, 2025
1 parent faccd63 commit 900eb05
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.seata.common.metadata.Instance;
import org.apache.seata.common.metadata.Node;
import org.apache.seata.common.thread.NamedThreadFactory;
import org.apache.seata.common.util.StringUtils;
import org.apache.seata.config.ConfigurationFactory;
import org.apache.seata.core.rpc.RemotingBootstrap;
import org.apache.seata.discovery.registry.MultiRegistryFactory;
Expand Down Expand Up @@ -173,7 +174,7 @@ public void initChannel(SocketChannel ch) {
this.serverBootstrap.bind(port).sync();
LOGGER.info("Server started, service listen port: {}", getListenPort());
Instance instance = Instance.getInstance();
if (instance.getTransaction() == null) {
if (instance.getTransaction() == null || StringUtils.isBlank(instance.getTransaction().getHost())) {
Instance.getInstance().setTransaction(new Node.Endpoint(XID.getIpAddress(), XID.getPort(), "netty"));
}
for (RegistryService<?> registryService : MultiRegistryFactory.getInstances()) {
Expand Down

0 comments on commit 900eb05

Please sign in to comment.