Close file handler in textfile

This commit is contained in:
slene 2016-06-30 00:06:18 +08:00
parent 49f562136d
commit dea279267a
1 changed files with 1 additions and 0 deletions

View File

@ -91,6 +91,7 @@ func (c *textFileCollector) parseTextFiles() []*dto.MetricFamily {
} }
var parser expfmt.TextParser var parser expfmt.TextParser
parsedFamilies, err := parser.TextToMetricFamilies(file) parsedFamilies, err := parser.TextToMetricFamilies(file)
file.Close()
if err != nil { if err != nil {
log.Errorf("Error parsing %s: %v", path, err) log.Errorf("Error parsing %s: %v", path, err)
error = 1.0 error = 1.0