close file handle when FileRotator object will closed. Fixes https://github.com/hashicorp/nomad/issues/6309 (#6323)

This commit is contained in:
Ruslan Usifov 2019-09-13 17:31:13 +03:00 committed by Tim Gross
parent a6ef8c5d42
commit b3c72d1729
1 changed files with 1 additions and 0 deletions

View File

@ -256,6 +256,7 @@ func (f *FileRotator) Close() error {
f.doneCh <- struct{}{}
close(f.purgeCh)
f.closed = true
f.currentFile.Close()
}
return nil