mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-28 23:19:46 -08:00
Merge pull request #263 from slene/master
Close file handler in textfile
This commit is contained in:
commit
157ac23b4d
|
@ -91,6 +91,7 @@ func (c *textFileCollector) parseTextFiles() []*dto.MetricFamily {
|
|||
}
|
||||
var parser expfmt.TextParser
|
||||
parsedFamilies, err := parser.TextToMetricFamilies(file)
|
||||
file.Close()
|
||||
if err != nil {
|
||||
log.Errorf("Error parsing %s: %v", path, err)
|
||||
error = 1.0
|
||||
|
|
Loading…
Reference in a new issue