From 9c6e66f3158c099352b88a2aa60b7ef24741cb55 Mon Sep 17 00:00:00 2001 From: Ankit Nayan Date: Sun, 2 May 2021 20:49:54 +0530 Subject: [PATCH] fixed - now getting latest data for past time rather than get 30s stale there too --- pkg/query-service/app/parser.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/query-service/app/parser.go b/pkg/query-service/app/parser.go index 1bc9d1f38d..692fc8b74e 100644 --- a/pkg/query-service/app/parser.go +++ b/pkg/query-service/app/parser.go @@ -421,7 +421,10 @@ func parseTimeMinusBuffer(param string, r *http.Request) (*time.Time, error) { return nil, fmt.Errorf("%s param is not in correct timestamp format", param) } - timeUnix = timeUnix - 30000000000 + timeUnixNow := time.Now().UnixNano() + if timeUnix > timeUnixNow-30000000000 { + timeUnix = timeUnix - 30000000000 + } timeFmt := time.Unix(0, timeUnix)