mirror of
https://github.com/openziti/zrok.git
synced 2024-11-21 23:53:19 +01:00
commit
d34e024b66
@ -58,7 +58,9 @@ func (a *Agent) Start() error {
|
||||
}
|
||||
}
|
||||
if shouldAck {
|
||||
event.Ack()
|
||||
if err := event.Ack(); err != nil {
|
||||
logrus.Error("unable to Ack message", err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logrus.Error(err)
|
||||
|
@ -73,7 +73,7 @@ func (s *amqpSource) Start(events chan ZitiEventMsg) (join chan struct{}, err er
|
||||
for event := range s.msgs {
|
||||
events <- &ZitiEventAMQP{
|
||||
data: ZitiEventJson(event.Body),
|
||||
msg: &event,
|
||||
msg: event,
|
||||
}
|
||||
}
|
||||
close(s.join)
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/openziti/zrok/util"
|
||||
"github.com/pkg/errors"
|
||||
amqp "github.com/rabbitmq/amqp091-go"
|
||||
)
|
||||
|
||||
@ -58,7 +57,7 @@ func (e *ZitiEventJsonMsg) Ack() error {
|
||||
|
||||
type ZitiEventAMQP struct {
|
||||
data ZitiEventJson
|
||||
msg *amqp.Delivery
|
||||
msg amqp.Delivery
|
||||
}
|
||||
|
||||
func (e *ZitiEventAMQP) Data() ZitiEventJson {
|
||||
@ -66,9 +65,6 @@ func (e *ZitiEventAMQP) Data() ZitiEventJson {
|
||||
}
|
||||
|
||||
func (e *ZitiEventAMQP) Ack() error {
|
||||
if e.msg != nil {
|
||||
return errors.New("Nil delivery message")
|
||||
}
|
||||
return e.msg.Ack(false)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user