mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
app/vmselect: adjust end
arg instead of adjusting start
arg if start > end
`start` arg has higher chances to be set properly comparing to `end` arg, so it is expected that the `end` arg could be adjusted if it was set incorrectly.
This commit is contained in:
parent
90b03309de
commit
1f3fd2c910
1 changed files with 4 additions and 4 deletions
|
@ -131,7 +131,7 @@ func ExportHandler(w http.ResponseWriter, r *http.Request) error {
|
|||
format := r.FormValue("format")
|
||||
deadline := getDeadline(r)
|
||||
if start >= end {
|
||||
start = end - defaultStep
|
||||
end = start + defaultStep
|
||||
}
|
||||
if err := exportHandler(w, matches, start, end, format, deadline); err != nil {
|
||||
return err
|
||||
|
@ -286,7 +286,7 @@ func labelValuesWithMatches(labelName string, matches []string, start, end int64
|
|||
return nil, err
|
||||
}
|
||||
if start >= end {
|
||||
start = end - defaultStep
|
||||
end = start + defaultStep
|
||||
}
|
||||
sq := &storage.SearchQuery{
|
||||
MinTimestamp: start,
|
||||
|
@ -409,7 +409,7 @@ func SeriesHandler(w http.ResponseWriter, r *http.Request) error {
|
|||
return err
|
||||
}
|
||||
if start >= end {
|
||||
start = end - defaultStep
|
||||
end = start + defaultStep
|
||||
}
|
||||
sq := &storage.SearchQuery{
|
||||
MinTimestamp: start,
|
||||
|
@ -565,7 +565,7 @@ func QueryRangeHandler(w http.ResponseWriter, r *http.Request) error {
|
|||
return fmt.Errorf(`too long query; got %d bytes; mustn't exceed %d bytes`, len(query), *maxQueryLen)
|
||||
}
|
||||
if start > end {
|
||||
start = end
|
||||
end = start + defaultStep
|
||||
}
|
||||
if err := promql.ValidateMaxPointsPerTimeseries(start, end, step); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue