mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-01-15 08:39:06 +01:00
Check creation of CCMessage in NATS receiver
This commit is contained in:
parent
70a6afc549
commit
7d3180b526
@ -91,21 +91,22 @@ func (r *NatsReceiver) _NatsReceive(m *nats.Msg) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
y, _ := lp.NewMessage(
|
y, err := lp.NewMessage(
|
||||||
string(measurement),
|
string(measurement),
|
||||||
tags,
|
tags,
|
||||||
nil,
|
nil,
|
||||||
fields,
|
fields,
|
||||||
t,
|
t,
|
||||||
)
|
)
|
||||||
|
if err == nil {
|
||||||
m, err := r.mp.ProcessMessage(y)
|
m, err := r.mp.ProcessMessage(y)
|
||||||
if err == nil && m != nil {
|
if err == nil && m != nil && r.sink != nil {
|
||||||
r.sink <- m
|
r.sink <- m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Close closes the connection to the NATS server
|
// Close closes the connection to the NATS server
|
||||||
func (r *NatsReceiver) Close() {
|
func (r *NatsReceiver) Close() {
|
||||||
|
Loading…
Reference in New Issue
Block a user