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() {
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()