mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Add cache clearing and check links every two hours
This commit is contained in:
@ -3,7 +3,9 @@ using System.Collections;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Alphaleonis.Win32.Filesystem;
|
using Alphaleonis.Win32.Filesystem;
|
||||||
using Nancy;
|
using Nancy;
|
||||||
@ -119,10 +121,30 @@ namespace Wabbajack.CacheServer
|
|||||||
|
|
||||||
public static void Start()
|
public static void Start()
|
||||||
{
|
{
|
||||||
var tsk = ValidateLists();
|
new Thread(() =>
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ValidateLists().Wait();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Utils.Log(ex.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sleep for two hours
|
||||||
|
Thread.Sleep(1000 * 60 * 60 * 2);
|
||||||
|
}
|
||||||
|
}).Start();
|
||||||
}
|
}
|
||||||
public static async Task ValidateLists()
|
public static async Task ValidateLists()
|
||||||
{
|
{
|
||||||
|
Utils.Log("Cleaning Nexus Cache");
|
||||||
|
var client = new HttpClient();
|
||||||
|
await client.GetAsync("http://build.wabbajack.org/nexus_api_cache/update");
|
||||||
|
|
||||||
Utils.Log("Starting Modlist Validation");
|
Utils.Log("Starting Modlist Validation");
|
||||||
var modlists = await ModlistMetadata.LoadFromGithub();
|
var modlists = await ModlistMetadata.LoadFromGithub();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user