Skip to content

Commit

Permalink
Update LastConnected metric for async reading
Browse files Browse the repository at this point in the history
Signed-off-by: Lindsey Cheng <beckysocute@gmail.com>
  • Loading branch information
lindseysimple committed Sep 20, 2023
1 parent 5ba35e1 commit 352f41d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/service/async.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func (s *deviceService) sendAsyncValues(acv *sdkModels.AsyncValues, working chan
<-working
}()

// Update the LastConnected metric in deviceCache
cache.Devices().SetLastConnectedByName(acv.DeviceName)

if len(acv.CommandValues) == 0 {
s.lc.Error("Skip sending AsyncValues because the CommandValues is empty.")
return
Expand Down

0 comments on commit 352f41d

Please sign in to comment.