implement count rpc
All checks were successful
Build and Publish / release (push) Has been skipped
Build and Publish / check-chart (push) Successful in 11s
Build and Publish / helm-release (push) Has been skipped

This commit is contained in:
2025-03-27 15:32:10 -04:00
parent eeea3c7cb7
commit d847c36715
9 changed files with 345 additions and 52 deletions

View File

@ -75,7 +75,12 @@ func ApplyOptsToUpdates(updates []*weather.WeatherUpdate, limit int, opts *pb.Ge
return updates
}
filtered := make([]*weather.WeatherUpdate, 0, limit)
capacity := len(updates)
if limit > 0 {
capacity = limit
}
filtered := make([]*weather.WeatherUpdate, 0, capacity)
for i := len(updates) - 1; i >= 0; i-- {
update := updates[i]