app/vmselect/promql: simplify defer call for querystats.RegisterQuery

This commit is contained in:
Aliaksandr Valialkin 2020-12-27 12:06:04 +02:00
parent 44932098b5
commit 0e739efc88

View File

@ -43,9 +43,7 @@ func Exec(ec *EvalConfig, q string, isFirstPointOnly bool) ([]netstorage.Result,
if querystats.Enabled() { if querystats.Enabled() {
startTime := time.Now() startTime := time.Now()
ac := ec.AuthToken ac := ec.AuthToken
defer func() { defer querystats.RegisterQuery(ac.AccountID, ac.ProjectID, q, ec.End-ec.Start, startTime)
querystats.RegisterQuery(ac.AccountID, ac.ProjectID, q, ec.End-ec.Start, startTime)
}()
} }
ec.validate() ec.validate()