More logging information for server backend

This commit is contained in:
Timothy Baldridge 2020-11-11 06:25:57 -07:00
parent fd74b1b4dc
commit 01872fb62b
3 changed files with 13 additions and 2 deletions

View File

@ -282,6 +282,7 @@ namespace Wabbajack.Lib.Downloaders
return (newArchive, new TempFile());
}
Utils.Log($"Downloading possible upgrade {newArchive.State.PrimaryKeyString}");
var tempFile = new TempFile();
await newArchive.State.Download(newArchive, tempFile.Path);
@ -289,6 +290,8 @@ namespace Wabbajack.Lib.Downloaders
newArchive.Size = tempFile.Path.Size;
newArchive.Hash = await tempFile.Path.FileHashAsync();
Utils.Log($"Possible upgrade {newArchive.State.PrimaryKeyString} downloaded");
return (newArchive, tempFile);
}

View File

@ -321,7 +321,7 @@ namespace Wabbajack.Lib.NexusApi
try
{
Utils.Log($"Requesting manual download for {archive.Name}");
Utils.Log($"Requesting manual download for {archive.Name} {archive.PrimaryKeyString}");
return (await Utils.Log(await ManuallyDownloadNexusFile.Create(archive)).Task).ToString();
}
catch (TaskCanceledException ex)

View File

@ -25,7 +25,15 @@ namespace Wabbajack.Server.Services
var keys = await _sql.GetNexusApiKeysWithCounts(1500);
foreach (var key in keys.Where(k => k.Key != _selfKey))
{
return new TrackingClient(_sql, key);
var client = new TrackingClient(_sql, key);
if (!await client.IsPremium())
{
_logger.LogWarning($"Purging non premium key");
await _sql.DeleteNexusAPIKey(key.Key);
continue;
}
return client;
}
return await NexusApiClient.Get();