Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
Close file for windows platform
Browse files Browse the repository at this point in the history
Windows needs files that are being deleted to be closed.

Fixes: prometheus/prometheus#3956

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
  • Loading branch information
gouthamve committed Mar 14, 2018
1 parent 00404ae commit 9744de2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ func repairBadIndexVersion(logger log.Logger, dir string) error {
if err := repl.Close(); err != nil {
return err
}
if err := broken.Close(); err != nil {
return err
}
if err := renameFile(repl.Name(), broken.Name()); err != nil {
return err
}
Expand Down

0 comments on commit 9744de2

Please sign in to comment.