mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect/prometheus: consistently apply nocache
arg to /api/v1/query
the same way ast to /api/v1/query_range
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/241
This commit is contained in:
parent
e0ac068112
commit
def9ccd360
1 changed files with 3 additions and 1 deletions
|
@ -554,7 +554,9 @@ func QueryHandler(at *auth.Token, w http.ResponseWriter, r *http.Request) error
|
||||||
if len(query) > *maxQueryLen {
|
if len(query) > *maxQueryLen {
|
||||||
return fmt.Errorf(`too long query; got %d bytes; mustn't exceed %d bytes`, len(query), *maxQueryLen)
|
return fmt.Errorf(`too long query; got %d bytes; mustn't exceed %d bytes`, len(query), *maxQueryLen)
|
||||||
}
|
}
|
||||||
if ct-start < queryOffset {
|
if !getBool(r, "nocache") && ct-start < queryOffset {
|
||||||
|
// Adjust start time only if `nocache` arg isn't set.
|
||||||
|
// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/241
|
||||||
start = ct - queryOffset
|
start = ct - queryOffset
|
||||||
}
|
}
|
||||||
if childQuery, windowStr, offsetStr := promql.IsMetricSelectorWithRollup(query); childQuery != "" {
|
if childQuery, windowStr, offsetStr := promql.IsMetricSelectorWithRollup(query); childQuery != "" {
|
||||||
|
|
Loading…
Reference in a new issue