3
0

Add missing rows.Close() on reporting building

This commit is contained in:
Denis Arh
2020-08-29 16:06:26 +02:00
parent 621cc32033
commit 33c6f30a19
+5
View File
@@ -116,10 +116,15 @@ func (r record) Report(module *types.Module, metrics, dimensions, filter string)
} else if rows, err := r.db().Query(query, args...); err != nil {
return nil, errors.Wrapf(err, "can not execute report query (%s)", query)
} else {
defer rows.Close()
for rows.Next() {
result = append(result, crb.Cast(rows))
}
if err = rows.Err(); err != nil {
return nil, err
}
return result, nil
}
}