Fallback for file deletion, fix server code for the proxy

This commit is contained in:
Halgari 2022-12-28 15:45:46 -07:00
parent 11859d2304
commit a4137255de
4 changed files with 32 additions and 1 deletions

View File

@ -1,10 +1,11 @@
### Changelog
#### Version - 3.0.6.0 - ??
#### Version - 3.0.5.0 - ??
* Add support for Cubemaps in BA2 files, if you have problems with BA2 recompression, be sure to delete your `GlobalVFSCache3.sqlite` from your AppData before the next compile
* Fixed slides not being shown during installation for lists compile with the 3.0 compiler
* Set the "While loading slide" debug message to be `Trace` level, set the default minimum log level to `Information`
#### Version - 3.0.5.0 - 12/22/2022
* Add support for https://www.nexusmods.com/site hosted mods.
* Fix Website Links

View File

@ -0,0 +1,16 @@
using Wabbajack.DTOs.DownloadStates;
namespace Wabbajack.Downloaders.VerificationCache;
public class NullCache : IVerificationCache
{
public async Task<(bool? IsValid, IDownloadState State)> Get(IDownloadState state)
{
return (null, state);
}
public Task Put(IDownloadState archive, bool valid)
{
return Task.CompletedTask;
}
}

View File

@ -41,6 +41,18 @@ public static class AbsolutePathExtensions
throw;
}
}
catch (IOException ex)
{
if (ex.Message.Contains("because it is being used by another process"))
{
Thread.Sleep(1000);
File.Delete(path);
}
else
{
throw;
}
}
}
if (Directory.Exists(path))
file.DeleteDirectory();

View File

@ -23,6 +23,7 @@ using Newtonsoft.Json;
using Octokit;
using Wabbajack.BuildServer;
using Wabbajack.Downloaders;
using Wabbajack.Downloaders.VerificationCache;
using Wabbajack.DTOs;
using Wabbajack.DTOs.JsonConverters;
using Wabbajack.DTOs.Logins;
@ -97,6 +98,7 @@ public class Startup
var settings = s.GetRequiredService<AppSettings>();
return new TemporaryFileManager(settings.TempPath.Combine(Environment.ProcessId + "_" + Guid.NewGuid()));
});
services.AddSingleton<IVerificationCache, NullCache>();
services.AddAllSingleton<ITokenProvider<WabbajackApiState>, WabbajackApiTokenProvider>();
services.AddAllSingleton<IResource, IResource<DownloadDispatcher>>(s => new Resource<DownloadDispatcher>("Downloads", 12));