chore: improve logging

This commit is contained in:
andig 2025-10-06 14:37:28 +02:00
parent 98488e98cf
commit a67c904d4e

View file

@ -82,6 +82,8 @@ func (v *MqttConnector) runMqtt(ctx context.Context, token *oauth2.Token) error
gcid := TokenExtra(token, "gcid")
idToken := TokenExtra(token, "id_token")
v.log.DEBUG.Printf("connect streaming (using gcid %s/ id %s, valid until: %v)", gcid, idToken, token.Expiry.Round(time.Second))
paho := mqtt.NewClient(
mqtt.NewClientOptions().
AddBroker(StreamingURL).
@ -95,7 +97,7 @@ func (v *MqttConnector) runMqtt(ctx context.Context, token *oauth2.Token) error
} else if err := t.Error(); err != nil {
return fmt.Errorf("connect: %w", err)
}
defer paho.Disconnect(0)
defer paho.Disconnect(1000)
topic := fmt.Sprintf("%s/#", gcid)