[agent-go] - 更新ServerInfo的字段

This commit is contained in:
zeaslity
2024-04-29 17:30:15 +08:00
parent ed29a457a3
commit f1a2b82614
21 changed files with 357 additions and 161 deletions

View File

@@ -92,7 +92,7 @@ func INIT(octopusAgentConfigFileName string) chan bool {
}
// 建立 运行时 RabbitMQ连接
runtimeConnectorQueue := buildAndStartBusinessRuntimeQueue(a_agent.AgentServerInfoCache.TopicName)
runtimeConnectorQueue := buildAndStartBusinessRuntimeQueue(a_agent.AgentServerInfoCache.AgentTopicName)
// 激活子模块
activatedOctopusAgentModules()
@@ -318,6 +318,8 @@ func uniformAgentServerName(agentInfo *a_status.AgentInfo, agentServerInfo *a_ag
// linux host architecture
arch := getMachineType(agentInfo.HostInfo.KernelArch)
agentServerInfo.CPUArch = arch
var numS string
if agentServerInfo.ServerIPInV4 != "" {
split := strings.Split(agentServerInfo.ServerIPInV4, ".")
@@ -433,7 +435,7 @@ func refreshAgentNetworkInfo(agentInfo *a_status.AgentInfo, agentServerInfo *a_a
if publicNetworkInfo.IP != "" {
agentServerInfo.ServerIPPbV4 = publicNetworkInfo.IP
agentServerInfo.Region = publicNetworkInfo.Region
agentServerInfo.Province = publicNetworkInfo.Region
agentServerInfo.City = publicNetworkInfo.City
agentServerInfo.Country = publicNetworkInfo.Country
agentServerInfo.Location = publicNetworkInfo.Loc
@@ -507,7 +509,7 @@ func handleInitMsgFromServer(initFromServerMsg *rabbitmq.OctopusMessage, initToS
g.G.AgentHasRegister = true
// 保存真实的AgentTopicName
a_agent.AgentServerInfoCache.TopicName = serverInfo.TopicName
a_agent.AgentServerInfoCache.AgentTopicName = serverInfo.AgentTopicName
} else {
// 不是自身的 注册回复信息 -- 拒绝 2023年6月19日 此处存在错误! 会死循环Nack 导致异常