Merge branch 'master' into issue-857

This commit is contained in:
Timothy Baldridge 2020-05-30 08:31:46 -07:00 committed by GitHub
commit 14ecd35e62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 9 deletions

View File

@ -1,5 +1,8 @@
### Changelog ### Changelog
#### Version - 2.0.8.0 - ??
* Make sure the MEGA client is logged out before logging in (#881)
* Removed final references to `nexus_link_cache` (#865)
* Run disk benchmarks for 10 seconds and use a tiered approach to disk queue size calculation of disks * Run disk benchmarks for 10 seconds and use a tiered approach to disk queue size calculation of disks
#### Version - 2.0.7.0 - 5/28/2020 #### Version - 2.0.7.0 - 5/28/2020

View File

@ -41,8 +41,6 @@ namespace Wabbajack.Common
public static readonly Extension ESM = new Extension(".esm"); public static readonly Extension ESM = new Extension(".esm");
public static readonly Extension ESP = new Extension(".esp"); public static readonly Extension ESP = new Extension(".esp");
public static string NexusCacheDirectory = "nexus_link_cache";
public static string WABBAJACK_INCLUDE = "WABBAJACK_INCLUDE"; public static string WABBAJACK_INCLUDE = "WABBAJACK_INCLUDE";
public static string WABBAJACK_ALWAYS_ENABLE = "WABBAJACK_ALWAYS_ENABLE"; public static string WABBAJACK_ALWAYS_ENABLE = "WABBAJACK_ALWAYS_ENABLE";
public static string WABBAJACK_NOMATCH_INCLUDE = "WABBAJACK_NOMATCH_INCLUDE"; public static string WABBAJACK_NOMATCH_INCLUDE = "WABBAJACK_NOMATCH_INCLUDE";

View File

@ -95,7 +95,7 @@ namespace Wabbajack.Common
public ValueTask<FileStream> Create() public ValueTask<FileStream> Create()
{ {
var path = _path; var path = _path;
return CircuitBreaker.WithAutoRetry<FileStream, IOException>(async () => File.Create(path)); return CircuitBreaker.WithAutoRetry<FileStream, IOException>(async () => File.Open(path, FileMode.Create, FileAccess.ReadWrite));
} }
public ValueTask<FileStream> OpenWrite() public ValueTask<FileStream> OpenWrite()
@ -382,7 +382,7 @@ namespace Wabbajack.Common
{ {
var path = _path; var path = _path;
return CircuitBreaker.WithAutoRetry<FileStream, IOException>(async () => return CircuitBreaker.WithAutoRetry<FileStream, IOException>(async () =>
File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read)); File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));
} }
public ValueTask<FileStream> WriteShared() public ValueTask<FileStream> WriteShared()

View File

@ -14,8 +14,7 @@ namespace Wabbajack.Lib.CompilationSteps
{ {
_cruftFiles = new HashSet<string> _cruftFiles = new HashSet<string>
{ {
"7z.dll", "7z.exe", "vfs_staged_files\\", "nexus.key_cache", "patch_cache\\", "7z.dll", "7z.exe", "vfs_staged_files\\", "nexus.key_cache", "patch_cache\\"
Consts.NexusCacheDirectory + "\\"
}; };
} }

View File

@ -53,6 +53,15 @@ namespace Wabbajack.Lib.Downloaders
{ {
MegaApiClient.AuthInfos authInfos; MegaApiClient.AuthInfos authInfos;
try
{
MegaApiClient.Logout();
}
catch (NotSupportedException ex)
{
// Not logged in, so ignore
}
try try
{ {
authInfos = MegaApiClient.GenerateAuthInfos(username, password.ToNormalString(), mfa); authInfos = MegaApiClient.GenerateAuthInfos(username, password.ToNormalString(), mfa);

View File

@ -246,9 +246,6 @@ namespace Wabbajack.Lib.NexusApi
headers.Add(("Accept", "application/json")); headers.Add(("Accept", "application/json"));
headers.Add(("Application-Name", Consts.AppName)); headers.Add(("Application-Name", Consts.AppName));
headers.Add(("Application-Version", $"{Assembly.GetEntryAssembly()?.GetName()?.Version ?? new Version(0, 1)}")); headers.Add(("Application-Version", $"{Assembly.GetEntryAssembly()?.GetName()?.Version ?? new Version(0, 1)}"));
if (!Directory.Exists(Consts.NexusCacheDirectory))
Directory.CreateDirectory(Consts.NexusCacheDirectory);
} }
public static async Task<NexusApiClient> Get(string? apiKey = null) public static async Task<NexusApiClient> Get(string? apiKey = null)