Merge pull request #1273 from LostDragonist/less_ram

Reduce memory used by open file streams
This commit is contained in:
Timothy Baldridge 2021-01-29 07:59:09 -07:00 committed by GitHub
commit 53a1e7af74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -398,14 +398,14 @@ namespace Wabbajack.Common
{ {
var path = _path; var path = _path;
return CircuitBreaker.WithAutoRetryAsync<FileStream, IOException>(async () => return CircuitBreaker.WithAutoRetryAsync<FileStream, IOException>(async () =>
File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, bufferSize: 1048576, useAsync: true)); File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, bufferSize: 4096, useAsync: true));
} }
public ValueTask<FileStream> WriteShared() public ValueTask<FileStream> WriteShared()
{ {
var path = _path; var path = _path;
return CircuitBreaker.WithAutoRetryAsync<FileStream, IOException>(async () => return CircuitBreaker.WithAutoRetryAsync<FileStream, IOException>(async () =>
File.Open(path, FileMode.Open, FileAccess.Write, FileShare.ReadWrite, bufferSize: 1048576, useAsync: true)); File.Open(path, FileMode.Open, FileAccess.Write, FileShare.ReadWrite, bufferSize: 4096, useAsync: true));
} }
public async Task CopyDirectoryToAsync(AbsolutePath destination) public async Task CopyDirectoryToAsync(AbsolutePath destination)