Skip to content

Commit

Permalink
fix(device): Fix reconnect failures clearing device metadata
Browse files Browse the repository at this point in the history
Fixes #47
  • Loading branch information
gabe565 committed Nov 23, 2023
1 parent afeb347 commit 14f43eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/device/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,11 @@ func (d *Device) connect(opts ...application.ApplicationOption) error {
if err := d.app.Start(d.entry.GetAddr(), d.entry.GetPort()); err != nil {
d.logger.Debug("Failed to connect to device. Retrying...", "try", try, "error", err.Error())

var subErr error
if d.entry, subErr = DiscoverCastDNSEntryByUuid(d.ctx, d.entry.UUID); subErr != nil {
newEntry, subErr := DiscoverCastDNSEntryByUuid(d.ctx, d.entry.UUID)
if subErr != nil {
return subErr
}
d.entry = newEntry

return err
}
Expand Down

0 comments on commit 14f43eb

Please sign in to comment.