mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
minor enhancement: return multi error when closeAll() (#663)
Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
This commit is contained in:
parent
7dd5e177aa
commit
bff3ef3db4
|
@ -502,11 +502,11 @@ func sequenceFiles(dir string) ([]string, error) {
|
|||
return res, nil
|
||||
}
|
||||
|
||||
func closeAll(cs []io.Closer) (err error) {
|
||||
func closeAll(cs []io.Closer) error {
|
||||
var merr tsdb_errors.MultiError
|
||||
|
||||
for _, c := range cs {
|
||||
if e := c.Close(); e != nil {
|
||||
err = e
|
||||
}
|
||||
merr.Add(c.Close())
|
||||
}
|
||||
return err
|
||||
return merr.Err()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue