Skip to content

Commit

Permalink
chore: more agent debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
fritterhoff committed Oct 26, 2023
1 parent b83d924 commit 4aa6cca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/step-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var agent = cli.Command{
}

// Subscribe to topic
client.Subscribe(fmt.Sprintf("%s/jobs", c.String("organization")), 0, func(client mqtt.Client, msg mqtt.Message) {
token := client.Subscribe(fmt.Sprintf("%s/jobs", c.String("organization")), 0, func(client mqtt.Client, msg mqtt.Message) {
logrus.Infof("received message on topic %s", msg.Topic())
logrus.Infof("message: %s", msg.Payload())

Expand Down Expand Up @@ -125,6 +125,10 @@ var agent = cli.Command{

})

if token.WaitTimeout(30*time.Second) && token.Error() != nil {
logrus.WithError(token.Error()).Warn("subscribing failed")
}

return nil
},
}
Expand Down

0 comments on commit 4aa6cca

Please sign in to comment.