[agent-go] [status] - update code
This commit is contained in:
@@ -109,6 +109,7 @@ func executorOMHandler(octopusMessage *OctopusMessage) {
|
||||
func statusOMHandler(octopusMessage *OctopusMessage) {
|
||||
|
||||
statusMsgString := octopusMessage.Content.(string)
|
||||
|
||||
var statusMessage *status.StatusMessage
|
||||
err := json.Unmarshal([]byte(statusMsgString), &statusMessage)
|
||||
if err != nil {
|
||||
@@ -132,5 +133,5 @@ func statusOMHandler(octopusMessage *OctopusMessage) {
|
||||
}
|
||||
|
||||
func blackHoleOMHandler(octopusMessage *OctopusMessage) {
|
||||
log.Error(fmt.Sprintf("octopusMessage type wrong! msg is => %v", octopusMessage))
|
||||
log.Error(fmt.Sprintf("[BLACK HOLE] octopusMessage type wrong! msg is => %v", octopusMessage))
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ func (r *RabbitQueue) Connect() {
|
||||
if err = ch.ExchangeDeclare(
|
||||
r.RabbitProp.ExchangeName, // name of the exchange
|
||||
r.RabbitProp.ExchangeType, // type of the exchange
|
||||
false, // durable
|
||||
true, // durable
|
||||
false, // delete when complete
|
||||
false, // internal
|
||||
false, // noWait
|
||||
@@ -101,7 +101,7 @@ func (r *RabbitQueue) Connect() {
|
||||
|
||||
_, err = ch.QueueDeclare(
|
||||
r.RabbitProp.QueueName, // name of the queue
|
||||
false, // durable
|
||||
true, // durable
|
||||
false, // delete when unused
|
||||
false, // exclusive
|
||||
false, // noWait
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"uuid": "2023-03-27 14:38:49",
|
||||
"init_time": "2023-03-27T14:38:49.8162801+08:00",
|
||||
"type": "STATUS",
|
||||
"content": "{\n\"type\": \"status\",\n\"agent_topic_name\": \"exampleAgentTopicName\",\n\"metric_repeat_count\": 0,\n\"metric_repeat_pinch\": 0\n}",
|
||||
"result": "",
|
||||
"ac_time": "0001-01-01T00:00:00Z"
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"uuid": "2023-03-27 14:38:49",
|
||||
"init_time": "2023-03-27T14:38:49.8162801+08:00",
|
||||
"type": "PING",
|
||||
"content": "ping",
|
||||
"type": "STATUS",
|
||||
"content": "{\n\"type\": \"ping\",\n\"agent_topic_name\": \"exampleAgentTopicName\",\n\"metric_repeat_count\": 0,\n\"metric_repeat_pinch\": 0\n}",
|
||||
"result": "",
|
||||
"ac_time": "0001-01-01T00:00:00Z"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user