Close file for windows platform

Windows needs files that are being deleted to be closed.

Fixes: https://github.com/prometheus/prometheus/issues/3956

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
Goutham Veeramachaneni 2018-03-14 13:08:40 +05:30
parent 00404ae5ab
commit 9744de20cc
No known key found for this signature in database
GPG key ID: F1C217E8E9023CAD

View file

@ -61,6 +61,9 @@ func repairBadIndexVersion(logger log.Logger, dir string) error {
if err := repl.Close(); err != nil { if err := repl.Close(); err != nil {
return err return err
} }
if err := broken.Close(); err != nil {
return err
}
if err := renameFile(repl.Name(), broken.Name()); err != nil { if err := renameFile(repl.Name(), broken.Name()); err != nil {
return err return err
} }