Skip to content

Commit

Permalink
Rename caches so that they auto-rehash
Browse files Browse the repository at this point in the history
  • Loading branch information
halgari committed Jan 16, 2024
1 parent d25834c commit 61b3f70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Wabbajack.Services.OSIntegrated/ServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ public static IServiceCollection AddOSIntegrated(this IServiceCollection service
service.AddSingleton(s => options.UseLocalCache
? new FileHashCache(s.GetService<TemporaryFileManager>()!.CreateFile().Path,
s.GetService<IResource<FileHashCache>>()!)
: new FileHashCache(KnownFolders.AppDataLocal.Combine("Wabbajack", "GlobalHashCache.sqlite"),
: new FileHashCache(KnownFolders.AppDataLocal.Combine("Wabbajack", "GlobalHashCache2.sqlite"),
s.GetService<IResource<FileHashCache>>()!));

service.AddSingleton<IVfsCache>(s =>
{
var diskCache = options.UseLocalCache
? new VFSDiskCache(s.GetService<TemporaryFileManager>()!.CreateFile().Path)
: new VFSDiskCache(KnownFolders.WabbajackAppLocal.Combine("GlobalVFSCache4.sqlite"));
: new VFSDiskCache(KnownFolders.WabbajackAppLocal.Combine("GlobalVFSCache5.sqlite"));
var cesiCache = new CesiVFSCache(s.GetRequiredService<ILogger<CesiVFSCache>>(),
s.GetRequiredService<Client>());
return new FallthroughVFSCache(new IVfsCache[] {diskCache});
Expand All @@ -92,7 +92,7 @@ public static IServiceCollection AddOSIntegrated(this IServiceCollection service
TimeSpan.FromDays(1),
dtos)
: new VerificationCache(s.GetRequiredService<ILogger<VerificationCache>>(),
KnownFolders.WabbajackAppLocal.Combine("VerificationCacheV2.sqlite"),
KnownFolders.WabbajackAppLocal.Combine("VerificationCacheV3.sqlite"),
TimeSpan.FromDays(1),
dtos);
});
Expand Down
4 changes: 2 additions & 2 deletions Wabbajack.VFS.Test/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public void ConfigureServices(IServiceCollection service)

// Keep this fixed at 2 so that we can detect deadlocks in the VFS parallelOptions
service.AddSingleton(new ParallelOptions {MaxDegreeOfParallelism = 2});
service.AddSingleton(new FileHashCache(KnownFolders.EntryPoint.Combine("hashcache.sqlite"),
service.AddSingleton(new FileHashCache(KnownFolders.EntryPoint.Combine("hashcache_2.sqlite"),
new Resource<FileHashCache>("File Hashing", 10)));
service.AddAllSingleton<IVfsCache, VFSDiskCache>(x => new VFSDiskCache(KnownFolders.EntryPoint.Combine("vfscache.sqlite")));
service.AddAllSingleton<IVfsCache, VFSDiskCache>(x => new VFSDiskCache(KnownFolders.EntryPoint.Combine("vfscache_2.sqlite")));
service.AddTransient<Context>();
service.AddSingleton<FileExtractor.FileExtractor>();
}
Expand Down

0 comments on commit 61b3f70

Please sign in to comment.