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

View file

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