mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Small server improvements
This commit is contained in:
parent
936fee5d0c
commit
9074941229
@ -71,6 +71,14 @@ namespace Wabbajack.CacheServer
|
||||
}
|
||||
|
||||
public static async Task StartJobQueue()
|
||||
{
|
||||
foreach (var task in Enumerable.Range(0, 4))
|
||||
{
|
||||
var tsk = StartJobQueueInner();
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task StartJobQueueInner()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
|
@ -66,6 +66,7 @@ namespace Wabbajack.CacheServer.Jobs
|
||||
File.Delete(downloadDest);
|
||||
else
|
||||
File.Move(downloadDest, to_path);
|
||||
Utils.DeleteDirectory(Path.Combine(Server.Config.Indexer.DownloadDir, folder));
|
||||
}
|
||||
|
||||
return JobResult.Success();
|
||||
|
@ -105,7 +105,7 @@ namespace Wabbajack.CacheServer
|
||||
}
|
||||
}).FireAndForget();
|
||||
}
|
||||
public static async Task ValidateLists()
|
||||
public static async Task ValidateLists(bool skipIfNewer = true)
|
||||
{
|
||||
Utils.Log("Cleaning Nexus Cache");
|
||||
var client = new HttpClient();
|
||||
@ -133,6 +133,10 @@ namespace Wabbajack.CacheServer
|
||||
|
||||
private static async Task ValidateList(ModlistMetadata list, WorkQueue queue)
|
||||
{
|
||||
var existing = await Server.Config.ListValidation.Connect().FindOneAsync(l => l.Id == list.Links.MachineURL);
|
||||
if (existing != null && DateTime.Now - existing.DetailedStatus.Checked < TimeSpan.FromHours(2))
|
||||
return;
|
||||
|
||||
var modlist_path = Path.Combine(Consts.ModListDownloadFolder, list.Links.MachineURL + ExtensionManager.Extension);
|
||||
|
||||
if (list.NeedsDownload(modlist_path))
|
||||
|
@ -55,7 +55,7 @@ namespace Wabbajack.CacheServer
|
||||
return mods.Select(mod => new { game = game, mod = mod });
|
||||
}).ToList();
|
||||
|
||||
Utils.Log($"Getting update lits for {gameTasks.Count} games");
|
||||
Utils.Log($"Getting update list for {gameTasks.Count} games");
|
||||
|
||||
var purge = (await Task.WhenAll(gameTasks))
|
||||
.SelectMany(i => i)
|
||||
|
Loading…
Reference in New Issue
Block a user