[ Cmii ] [ Octopus ] - reformat agent-go - 2

This commit is contained in:
zeaslity
2024-03-29 15:04:27 +08:00
parent 1d32d7dd04
commit 77c689abd7
6 changed files with 128 additions and 76 deletions

View File

@@ -22,8 +22,6 @@ var P = g.G.P
var log = logger.Log
//var AgentServerInfoCache = &register.AgentServerInfo{}
func INIT(octopusAgentConfigFileName string, agentServerInfoConf string) chan bool {
// 获取系统的环境变量
@@ -153,6 +151,9 @@ func buildAndStartBusinessRuntimeQueue(agentTopicName string) chan bool {
// 开始处理Runtime的OM消息
businessForeverChan := octopusMsgQueue.Handle()
// cache it
rabbitmq.BusinessRuntimeQueue = octopusMsgQueue
return businessForeverChan
}
@@ -160,11 +161,20 @@ func buildAndStartBusinessRuntimeQueue(agentTopicName string) chan bool {
func activatedOctopusAgentModules() {
// Agent
a_agent.Activate()
err := P.Submit(func() {
a_agent.Activate()
})
if err != nil {
return
}
// Executor
a_executor.Activate()
_ = P.Submit(func() {
a_executor.Activate()
})
// Status
a_status.Activate()
_ = P.Submit(func() {
a_status.Activate()
})
}
func buildAndSendInitMsgToServer(agentServerInfo *a_agent.AgentServerInfo, initToServerQueue *rabbitmq.RabbitQueue) {