Skip to content

Commit

Permalink
Removed last_heartbeat update in MachineUpdateBaseMetrics (#3425)
Browse files Browse the repository at this point in the history
  • Loading branch information
srkoster authored Jan 23, 2025
1 parent 4935dc5 commit 62308f5
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions pkg/database/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ func (c *Client) MachineUpdateBaseMetrics(ctx context.Context, machineID string,
os := baseMetrics.Os
features := strings.Join(baseMetrics.FeatureFlags, ",")

var heartbeat time.Time

if len(baseMetrics.Metrics) == 0 {
heartbeat = time.Now().UTC()
} else {
heartbeat = time.Unix(*baseMetrics.Metrics[0].Meta.UtcNowTimestamp, 0)
}

hubState := map[string][]schema.ItemState{}
for itemType, items := range hubItems {
hubState[itemType] = []schema.ItemState{}
Expand All @@ -61,7 +53,6 @@ func (c *Client) MachineUpdateBaseMetrics(ctx context.Context, machineID string,
SetOsname(*os.Name).
SetOsversion(*os.Version).
SetFeatureflags(features).
SetLastHeartbeat(heartbeat).
SetHubstate(hubState).
SetDatasources(datasources).
Save(ctx)
Expand Down

0 comments on commit 62308f5

Please sign in to comment.