mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-11 22:09:05 +08:00
fix: handle 0 step interval (#7307)
This commit is contained in:
parent
7f71c0ed2d
commit
e614d6b0e9
@ -2,6 +2,7 @@ package inframetrics
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"sort"
|
||||
@ -15,6 +16,7 @@ import (
|
||||
"go.signoz.io/signoz/pkg/query-service/model"
|
||||
v3 "go.signoz.io/signoz/pkg/query-service/model/v3"
|
||||
"go.signoz.io/signoz/pkg/query-service/postprocess"
|
||||
"go.uber.org/zap"
|
||||
"golang.org/x/exp/maps"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
@ -413,6 +415,10 @@ func (h *HostsRepo) GetHostList(ctx context.Context, req model.HostListRequest)
|
||||
}
|
||||
|
||||
step := int64(math.Max(float64(common.MinAllowedStepInterval(req.Start, req.End)), 60))
|
||||
if step <= 0 {
|
||||
zap.L().Error("step is less than or equal to 0", zap.Int64("step", step))
|
||||
return resp, errors.New("step is less than or equal to 0")
|
||||
}
|
||||
|
||||
query := HostsTableListQuery.Clone()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user