mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -08:00
Close file descriptor in query logging (#11148)
Signed-off-by: Cosrider <cosrider7@gmail.com> Signed-off-by: Cosrider <cosrider7@gmail.com>
This commit is contained in:
parent
9594fa4dbd
commit
af79dce8ea
|
@ -64,6 +64,7 @@ func logUnfinishedQueries(filename string, filesize int, logger log.Logger) {
|
||||||
level.Error(logger).Log("msg", "Failed to open query log file", "err", err)
|
level.Error(logger).Log("msg", "Failed to open query log file", "err", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
defer fd.Close()
|
||||||
|
|
||||||
brokenJSON := make([]byte, filesize)
|
brokenJSON := make([]byte, filesize)
|
||||||
_, err = fd.Read(brokenJSON)
|
_, err = fd.Read(brokenJSON)
|
||||||
|
|
Loading…
Reference in a new issue