[agent-go] 调通Executor的代码

This commit is contained in:
zeaslity
2023-03-27 16:06:33 +08:00
parent 5accd999f8
commit 31f9267401
9 changed files with 124 additions and 54 deletions

View File

@@ -10,7 +10,8 @@ import (
func HandleOMsg(initOMsgFromServer *config.OctopusMessage) {
agentTopicName := initOMsgFromServer.UUID
agentTopicName := initOMsgFromServer.Result.(string)
OctopusExchange := g.G.NacosConfig.GetString("octopus.message.octopus_exchange")
octopusConnectProp := &ConnectProperty{
@@ -47,7 +48,7 @@ func HandleOMsg(initOMsgFromServer *config.OctopusMessage) {
var om *config.OctopusMessage
err := json.Unmarshal(delivery.Body, &om)
if err != nil {
log.Error("Octopus Message Parse Error !")
log.Error(fmt.Sprintf("octopus message convert to json is wrong! msg is => %s", delivery.Body))
// 保存到某处
continue
}
@@ -80,12 +81,12 @@ func executorOMHandler(octopusMessage *config.OctopusMessage) {
var executionMessage *config.ExecutionMessage
err := json.Unmarshal([]byte(executionMsgString), &executionMessage)
if err != nil {
log.Error(fmt.Sprintf("execution message convert to json is wrong! msg is => %s", executionMsgString))
return
}
// 交给后端的实际处理器处理, 再次策略
executor.Execute(octopusMessage, executionMessage)
}
func statusOMHandler(octopusMessage *config.OctopusMessage) {