Improve race condition handling with Patch generation

This commit is contained in:
Timothy Baldridge 2020-02-04 22:23:02 -07:00
parent cda2a5f54c
commit d8500fd618

View File

@ -832,10 +832,8 @@ namespace Wabbajack.Common
{
if (File.Exists(cacheFile))
{
using (var f = File.OpenRead(cacheFile))
{
await f.CopyToAsync(output);
}
await using var f = File.OpenRead(cacheFile);
await f.CopyToAsync(output);
}
else
{
@ -854,6 +852,8 @@ namespace Wabbajack.Common
}
catch (UnauthorizedAccessException)
{
if (File.Exists(cacheFile))
continue;
await Task.Delay(1000);
goto RETRY;
}