mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix the cache up a bit, throw log the file that fails during VFS analysis
This commit is contained in:
parent
1c0fec2d02
commit
3edf568ef7
@ -77,7 +77,7 @@ internal class Program
|
||||
services.AddSingleton<IVerb, DumpZipInfo>();
|
||||
services.AddSingleton<IVerb, Install>();
|
||||
services.AddSingleton<IVerb, InstallCompileInstallVerify>();
|
||||
services.AddSingleton<IVerb, HashUrlString>();
|
||||
services.AddSingleton<IVerb, HashUrlString>();
|
||||
services.AddSingleton<IVerb, DownloadAll>();
|
||||
|
||||
services.AddSingleton<IUserInterventionHandler, UserInterventionHandler>();
|
||||
|
@ -1,3 +1,5 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@ -27,7 +29,7 @@ public class CesiVFSCache : IVfsCache
|
||||
_logger.LogInformation("Requesting CESI Information for: {Hash} - Found", hash.ToHex());
|
||||
return result;
|
||||
}
|
||||
catch (HttpException exception)
|
||||
catch (Exception exception)
|
||||
{
|
||||
_logger.LogInformation("Requesting CESI Information for: {Hash} - Not Found", hash.ToHex());
|
||||
return null;
|
||||
|
@ -62,7 +62,7 @@ public static class ServiceExtensions
|
||||
{
|
||||
var diskCache = options.UseLocalCache
|
||||
? new VFSDiskCache(s.GetService<TemporaryFileManager>()!.CreateFile().Path)
|
||||
: new VFSDiskCache(KnownFolders.EntryPoint.Combine("GlobalVFSCache3.sqlite"));
|
||||
: new VFSDiskCache(KnownFolders.WabbajackAppLocal.Combine("GlobalVFSCache3.sqlite"));
|
||||
var cesiCache = new CesiVFSCache(s.GetRequiredService<ILogger<CesiVFSCache>>(),
|
||||
s.GetRequiredService<Client>());
|
||||
return new FallthroughVFSCache(new IVfsCache[] {diskCache, cesiCache});
|
||||
|
@ -70,7 +70,15 @@ public class Context
|
||||
if (found.LastModified == f.LastModifiedUtc().AsUnixTime() && found.Size == f.Size())
|
||||
return found;
|
||||
|
||||
return await VirtualFile.Analyze(this, null, new NativeFileStreamFactory(f), f, token, job: job);
|
||||
try
|
||||
{
|
||||
return await VirtualFile.Analyze(this, null, new NativeFileStreamFactory(f), f, token, job: job);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, "While analyzing {File}", f);
|
||||
throw;
|
||||
}
|
||||
}).ToList();
|
||||
|
||||
var newIndex = await IndexRoot.Empty.Integrate(filtered.Concat(allFiles).ToList());
|
||||
|
@ -21,9 +21,17 @@ public class FallthroughVFSCache : IVfsCache
|
||||
foreach (var cache in _caches)
|
||||
{
|
||||
if (result == null)
|
||||
{
|
||||
result = await cache.Get(hash, token);
|
||||
else
|
||||
await cache.Put(result, token);
|
||||
if (result == null) continue;
|
||||
foreach (var upperCache in _caches)
|
||||
{
|
||||
|
||||
if (upperCache != cache)
|
||||
await upperCache.Put(result, token);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user