Files
ProjectOctopus/agent-go/a_agent/AgentHandler.go
2024-06-14 10:37:40 +08:00

28 lines
561 B
Go
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package a_agent
import (
"time"
"wdd.io/agent-common/logger"
"wdd.io/agent-go/rabbitmq"
)
var log = logger.Log
func Activate() {
log.Info("Module [ AGENT ] activated !")
for {
if octopusMessage, ok := <-rabbitmq.BusinessRuntimeQueue.ReceiveChan.AgentRChan; ok {
// 处理数
// 输出日志
log.InfoF("接收到查询Agent状态的请求结果为 => %s", octopusMessage)
} else {
// channel已关闭跳出循环
log.ErrorF("business queue [ AGENT ] receive chan has closed !")
break
}
time.Sleep(time.Second * 20)
}
}