mirror of
https://github.com/openziti/zrok.git
synced 2025-06-24 19:51:32 +02:00
amqp reconnect tweak
This commit is contained in:
parent
1d09d32866
commit
2f604d3e71
@ -54,7 +54,7 @@ func (s *amqpSource) Start(events chan ZitiEventMsg) (join chan struct{}, err er
|
||||
|
||||
reconnect := false
|
||||
for {
|
||||
if reconnect {
|
||||
if reconnect || s.errs == nil {
|
||||
if err := s.reconnect(); err != nil {
|
||||
logrus.Errorf("error reconnecting: %v", err)
|
||||
continue
|
||||
@ -69,8 +69,8 @@ func (s *amqpSource) Start(events chan ZitiEventMsg) (join chan struct{}, err er
|
||||
msg: event,
|
||||
}
|
||||
}
|
||||
case err := <-s.errs:
|
||||
if err != nil {
|
||||
case err, ok := <-s.errs:
|
||||
if err != nil || !ok {
|
||||
logrus.Error(err)
|
||||
reconnect = true
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user