Add missing rows.Close() on reporting building
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user