Skip to content

Commit

Permalink
Update timesyncsensor.go
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Nov 7, 2024
1 parent 7beab85 commit fc649b0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions timesyncsensor/timesyncsensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"go.viam.com/rdk/components/sensor"
"go.viam.com/rdk/logging"
"go.viam.com/rdk/resource"
"go.viam.com/rdk/services/datamanager"

"go.viam.com/utils"
)
Expand Down Expand Up @@ -137,7 +136,7 @@ func (s *timeSyncer) Readings(context.Context, map[string]interface{}) (map[stri
hEnd, mEnd, sEnd, 0, zone)

readings := map[string]interface{}{"should_sync": false}
readings["time"] = currentTime
readings["time"] = currentTime.String()
// If it is between the start and end time, sync.
if currentTime.After(startTime) && currentTime.Before(endTime) {
s.logger.Debug("Syncing")
Expand All @@ -146,12 +145,12 @@ func (s *timeSyncer) Readings(context.Context, map[string]interface{}) (map[stri
}

// Otherwise, do not sync.
s.logger.Debug("Not syncing. Current time not in sync window: " + currentTime)
s.logger.Debug("Not syncing. Current time not in sync window: " + currentTime.String())
return readings, nil
}

// Close closes the underlying generic.
func (s *timeSyncer) Close(ctx context.Context) error {
s.cancelFunc()
return nil
}
}

0 comments on commit fc649b0

Please sign in to comment.