Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
RichieSams committed Apr 24, 2024
1 parent 76d0a81 commit 154e7cb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions processor/intervalprocessor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,21 +163,25 @@ func aggregateDataPoints[DPS metrics.DataPointSlice[DP], DP metrics.DataPoint[DP

existing, ok := state.Load(streamDataPointID)
if !ok {
state.Store(streamDataPointID, metrics.StreamDataPoint[DP]{
if err := state.Store(streamDataPointID, metrics.StreamDataPoint[DP]{
Metric: metric,
DataPoint: dp,
LastUpdated: now,
})
}); err != nil {
panic(fmt.Sprintf("Storing state should never panic, because HashMap always returns nil - Err: %v", err))
}
continue
}

// Check if the datapoint is newer
if dp.Timestamp().AsTime().After(existing.DataPoint.Timestamp().AsTime()) {
state.Store(streamDataPointID, metrics.StreamDataPoint[DP]{
if err := state.Store(streamDataPointID, metrics.StreamDataPoint[DP]{
Metric: metric,
DataPoint: dp,
LastUpdated: now,
})
}); err != nil {
panic(fmt.Sprintf("Storing state should never panic, because HashMap always returns nil - Err: %v", err))
}
continue
}

Expand Down

0 comments on commit 154e7cb

Please sign in to comment.