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, DumpZipInfo>();
|
||||||
services.AddSingleton<IVerb, Install>();
|
services.AddSingleton<IVerb, Install>();
|
||||||
services.AddSingleton<IVerb, InstallCompileInstallVerify>();
|
services.AddSingleton<IVerb, InstallCompileInstallVerify>();
|
||||||
services.AddSingleton<IVerb, HashUrlString>();
|
services.AddSingleton<IVerb, HashUrlString>();
|
||||||
services.AddSingleton<IVerb, DownloadAll>();
|
services.AddSingleton<IVerb, DownloadAll>();
|
||||||
|
|
||||||
services.AddSingleton<IUserInterventionHandler, UserInterventionHandler>();
|
services.AddSingleton<IUserInterventionHandler, UserInterventionHandler>();
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
using System;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
@ -27,7 +29,7 @@ public class CesiVFSCache : IVfsCache
|
|||||||
_logger.LogInformation("Requesting CESI Information for: {Hash} - Found", hash.ToHex());
|
_logger.LogInformation("Requesting CESI Information for: {Hash} - Found", hash.ToHex());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
catch (HttpException exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Requesting CESI Information for: {Hash} - Not Found", hash.ToHex());
|
_logger.LogInformation("Requesting CESI Information for: {Hash} - Not Found", hash.ToHex());
|
||||||
return null;
|
return null;
|
||||||
|
@ -62,7 +62,7 @@ public static class ServiceExtensions
|
|||||||
{
|
{
|
||||||
var diskCache = options.UseLocalCache
|
var diskCache = options.UseLocalCache
|
||||||
? new VFSDiskCache(s.GetService<TemporaryFileManager>()!.CreateFile().Path)
|
? 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>>(),
|
var cesiCache = new CesiVFSCache(s.GetRequiredService<ILogger<CesiVFSCache>>(),
|
||||||
s.GetRequiredService<Client>());
|
s.GetRequiredService<Client>());
|
||||||
return new FallthroughVFSCache(new IVfsCache[] {diskCache, cesiCache});
|
return new FallthroughVFSCache(new IVfsCache[] {diskCache, cesiCache});
|
||||||
|
@ -70,7 +70,15 @@ public class Context
|
|||||||
if (found.LastModified == f.LastModifiedUtc().AsUnixTime() && found.Size == f.Size())
|
if (found.LastModified == f.LastModifiedUtc().AsUnixTime() && found.Size == f.Size())
|
||||||
return found;
|
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();
|
}).ToList();
|
||||||
|
|
||||||
var newIndex = await IndexRoot.Empty.Integrate(filtered.Concat(allFiles).ToList());
|
var newIndex = await IndexRoot.Empty.Integrate(filtered.Concat(allFiles).ToList());
|
||||||
|
@ -21,9 +21,17 @@ public class FallthroughVFSCache : IVfsCache
|
|||||||
foreach (var cache in _caches)
|
foreach (var cache in _caches)
|
||||||
{
|
{
|
||||||
if (result == null)
|
if (result == null)
|
||||||
|
{
|
||||||
result = await cache.Get(hash, token);
|
result = await cache.Get(hash, token);
|
||||||
else
|
if (result == null) continue;
|
||||||
await cache.Put(result, token);
|
foreach (var upperCache in _caches)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (upperCache != cache)
|
||||||
|
await upperCache.Put(result, token);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user