Skip to content

Commit

Permalink
add check for no bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahstorm authored and aybabtme committed Oct 20, 2024
1 parent 82df90c commit 2c18a5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/localsvc/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ func (svc *Service) SummarizeEvents(ctx context.Context, req *connect.Request[qr
if req.Msg.To == nil {
req.Msg.To = timestamppb.Now()
}
if req.Msg.BucketCount < 1 {
return nil, connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("bucket count must be greater than 1"))
}
ll := svc.ll.With(
slog.Time("from", req.Msg.From.AsTime()),
slog.Time("to", req.Msg.From.AsTime()),
Expand Down

0 comments on commit 2c18a5a

Please sign in to comment.