Skip to content

Commit

Permalink
LiteDB now correctly initializes zero-byte files
Browse files Browse the repository at this point in the history
  • Loading branch information
lbnascimento committed Mar 15, 2021
1 parent 88233d0 commit 5ec64e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LiteDB/Engine/Disk/DiskService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public DiskService(EngineSettings settings, int[] memorySegmentSizes)
_dataPool = new StreamPool(_dataFactory, false);
_logPool = new StreamPool(_logFactory, true);

var isNew = _dataFactory.Exists() == false;
var isNew = !_dataFactory.Exists() || _dataFactory.GetLength() == 0L;

// create lazy async writer queue for log file
_queue = new Lazy<DiskWriterQueue>(() => new DiskWriterQueue(_logPool.Writer));
Expand Down

1 comment on commit 5ec64e5

@lbnascimento
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for #1956

Please sign in to comment.