From 0e739efc88bf1cb386e6b302127aecf030ba6981 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sun, 27 Dec 2020 12:06:04 +0200 Subject: [PATCH] app/vmselect/promql: simplify defer call for querystats.RegisterQuery --- app/vmselect/promql/exec.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/vmselect/promql/exec.go b/app/vmselect/promql/exec.go index 437fc003f4..6b55b5e594 100644 --- a/app/vmselect/promql/exec.go +++ b/app/vmselect/promql/exec.go @@ -43,9 +43,7 @@ func Exec(ec *EvalConfig, q string, isFirstPointOnly bool) ([]netstorage.Result, if querystats.Enabled() { startTime := time.Now() ac := ec.AuthToken - defer func() { - querystats.RegisterQuery(ac.AccountID, ac.ProjectID, q, ec.End-ec.Start, startTime) - }() + defer querystats.RegisterQuery(ac.AccountID, ac.ProjectID, q, ec.End-ec.Start, startTime) } ec.validate()