mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix tests
This commit is contained in:
parent
0f32321971
commit
8664c16d13
@ -15,6 +15,7 @@ using Wabbajack.Lib.ModListRegistry;
|
||||
using Wabbajack.Server;
|
||||
using Wabbajack.Server.DataLayer;
|
||||
using Wabbajack.Server.DTOs;
|
||||
using Wabbajack.Server.Services;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
@ -166,6 +167,8 @@ namespace Wabbajack.BuildServer.Test
|
||||
_client = new Wabbajack.Lib.Http.Client();
|
||||
_authedClient = new Wabbajack.Lib.Http.Client();
|
||||
Fixture = fixture.Deref();
|
||||
var cache = Fixture.GetService<MetricsKeyCache>();
|
||||
cache.AddKey(Metrics.GetMetricsKey().Result);
|
||||
_authedClient.Headers.Add(("x-api-key", Fixture.APIKey));
|
||||
AuthorAPI.ApiKeyOverride = Fixture.APIKey;
|
||||
_queue = new WorkQueue();
|
||||
|
@ -197,6 +197,7 @@ namespace Wabbajack.Server.Services
|
||||
private AsyncLock _healLock = new AsyncLock();
|
||||
private async Task<(Archive, ArchiveStatus)> TryToHeal(ValidationData data, Archive archive, ModlistMetadata modList)
|
||||
{
|
||||
using var _ = await _healLock.WaitAsync();
|
||||
var srcDownload = await _sql.GetArchiveDownload(archive.State.PrimaryKeyString, archive.Hash, archive.Size);
|
||||
if (srcDownload == null || srcDownload.IsFailed == true)
|
||||
{
|
||||
@ -219,7 +220,7 @@ namespace Wabbajack.Server.Services
|
||||
return (archive, ArchiveStatus.Updated);
|
||||
}
|
||||
|
||||
using var _ = await _healLock.WaitAsync();
|
||||
|
||||
var upgradeTime = DateTime.UtcNow;
|
||||
_logger.LogInformation($"Validator Finding Upgrade for {archive.Hash} {archive.State.PrimaryKeyString}");
|
||||
|
||||
|
@ -82,7 +82,7 @@ namespace Wabbajack.Server
|
||||
{
|
||||
options.Providers.Add<BrotliCompressionProvider>();
|
||||
options.Providers.Add<GzipCompressionProvider>();
|
||||
options.MimeTypes = new[] {"*/*"};
|
||||
options.MimeTypes = new[] {"application/json"};
|
||||
});
|
||||
|
||||
services.AddMvc();
|
||||
|
Loading…
Reference in New Issue
Block a user