Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mwindower committed Jul 9, 2024
1 parent 1ed6c09 commit 88ca140
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/bmc/nsq.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func (b *BMCService) InitConsumer() error {
MinVersion: tls.VersionTLS12,
}
config.TlsV1 = true
config.MaxAttempts = 3
config.MaxInFlight = 2

consumer, err := nsq.NewConsumer(b.machineTopic, mqChannel, config)
Expand All @@ -71,7 +70,11 @@ func (b *BMCService) HandleMessage(message *nsq.Message) error {
return err
}

b.log.Debug("got message", "topic", b.machineTopic, "channel", mqChannel, "event", event)
if message.attempt > 3 {

Check failure on line 73 in internal/bmc/nsq.go

View workflow job for this annotation

GitHub Actions / Docker Build

message.attempt undefined (type *nsq.Message has no field or method attempt)

Check failure on line 73 in internal/bmc/nsq.go

View workflow job for this annotation

GitHub Actions / Docker Build

message.attempt undefined (type *nsq.Message has no field or method attempt)
b.log.Warn("ignoring message because of multiple failed attempts", "topic", b.machineTopic, "channel", mqChannel, "event", event, "attempt", message.attempt)

Check failure on line 74 in internal/bmc/nsq.go

View workflow job for this annotation

GitHub Actions / Docker Build

message.attempt undefined (type *nsq.Message has no field or method attempt)

Check failure on line 74 in internal/bmc/nsq.go

View workflow job for this annotation

GitHub Actions / Docker Build

message.attempt undefined (type *nsq.Message has no field or method attempt)
return nil
}
b.log.Debug("got message", "topic", b.machineTopic, "channel", mqChannel, "event", event, "attempt", message.attempt)

Check failure on line 77 in internal/bmc/nsq.go

View workflow job for this annotation

GitHub Actions / Docker Build

message.attempt undefined (type *nsq.Message has no field or method attempt) (typecheck)

Check failure on line 77 in internal/bmc/nsq.go

View workflow job for this annotation

GitHub Actions / Docker Build

message.attempt undefined (type *nsq.Message has no field or method attempt)) (typecheck)

if event.Cmd.IPMI == nil {
return fmt.Errorf("event does not contain ipmi details:%v", event)
Expand Down

0 comments on commit 88ca140

Please sign in to comment.