[agent-go] [status] - update code

This commit is contained in:
zeaslity
2023-04-25 11:31:15 +08:00
parent 9a676b5087
commit 42b7b6e511
5 changed files with 20 additions and 11 deletions

View File

@@ -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))
}

View File

@@ -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

View File

@@ -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"
}

View File

@@ -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"
}

View File

@@ -2,22 +2,22 @@ spring:
application:
name: octopus-server
profiles:
active: k3s
active: local
cloud:
nacos:
config:
group: k3s
group: local
config-retry-time: 3000
file-extension: yaml
max-retry: 3
# server-addr: 43.154.83.213:21060
server-addr: 150.230.198.103:21060
server-addr: 42.192.52.227:21060
# server-addr: 150.230.198.103:21060
# server-addr: https://nacos.107421.xyz:443
timeout: 5000
config-long-poll-timeout: 5000
extension-configs:
- group: k3s
data-id: common-k3s.yaml
- group: local
data-id: common-local.yaml
server:
port: 9999