This commit is contained in:
2019-07-15 23:53:48 +01:00
commit 072e9b467a
2 changed files with 4 additions and 0 deletions

View File

@ -361,6 +361,8 @@ final class MappedSequentialFile implements SequentialFile {
@Override
public void close(boolean waitOnSync) {
if (this.mappedFile != null) {
if (factory.isDatasync())
this.mappedFile.force();
this.mappedFile.close();
this.mappedFile = null;
}

View File

@ -135,6 +135,8 @@ public class NIOSequentialFile extends AbstractSequentialFile {
try {
if (channel != null) {
if (factory.isDatasync())
channel.force(false);
channel.close();
}
} catch (ClosedChannelException e) {