From a7d5d611febffe2115045fb446538b1be1c0a723 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 4 Sep 2019 13:09:20 +0300 Subject: [PATCH] app/vmselect/prometheus: do not adjust `start` and `end` args in `/api/v1/query_range` if `nocache=1` arg is set Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/171 --- app/vmselect/prometheus/prometheus.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/vmselect/prometheus/prometheus.go b/app/vmselect/prometheus/prometheus.go index c3fedf1db..973e0c8b5 100644 --- a/app/vmselect/prometheus/prometheus.go +++ b/app/vmselect/prometheus/prometheus.go @@ -634,7 +634,9 @@ func QueryRangeHandler(at *auth.Token, w http.ResponseWriter, r *http.Request) e if err := promql.ValidateMaxPointsPerTimeseries(start, end, step); err != nil { return err } - start, end = promql.AdjustStartEnd(start, end, step) + if mayCache { + start, end = promql.AdjustStartEnd(start, end, step) + } ec := promql.EvalConfig{ AuthToken: at,