mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
remove statichutao
This commit is contained in:
@@ -30,9 +30,6 @@ internal sealed class ImageCache : IImageCache, IImageCacheFilePathOperation
|
||||
[0] = TimeSpan.FromSeconds(4),
|
||||
[1] = TimeSpan.FromSeconds(16),
|
||||
[2] = TimeSpan.FromSeconds(64),
|
||||
[3] = TimeSpan.FromSeconds(4),
|
||||
[4] = TimeSpan.FromSeconds(16),
|
||||
[5] = TimeSpan.FromSeconds(64),
|
||||
};
|
||||
|
||||
private readonly ILogger logger;
|
||||
@@ -173,7 +170,7 @@ internal sealed class ImageCache : IImageCache, IImageCacheFilePathOperation
|
||||
|
||||
int retryCount = 0;
|
||||
HttpClient httpClient = httpClientFactory.CreateClient(nameof(ImageCache));
|
||||
while (retryCount < 6)
|
||||
while (retryCount < 3)
|
||||
{
|
||||
using (HttpResponseMessage message = await httpClient.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false))
|
||||
{
|
||||
@@ -191,10 +188,6 @@ internal sealed class ImageCache : IImageCache, IImageCacheFilePathOperation
|
||||
|
||||
switch (message.StatusCode)
|
||||
{
|
||||
case HttpStatusCode.NotFound:
|
||||
// directly goto https://static.hut.ao
|
||||
retryCount += 3;
|
||||
break;
|
||||
case HttpStatusCode.TooManyRequests:
|
||||
{
|
||||
retryCount++;
|
||||
@@ -208,11 +201,6 @@ internal sealed class ImageCache : IImageCache, IImageCacheFilePathOperation
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (retryCount == 3)
|
||||
{
|
||||
uri = new UriBuilder(uri) { Host = Web.HutaoEndpoints.StaticHutao }.Uri;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ internal static class StaticResource
|
||||
ApplicationDataCompositeValue map = LocalSetting.Get(ContractMap, DefaultResourceVersionMap);
|
||||
foreach ((string key, object value) in LatestResourceVersionMap)
|
||||
{
|
||||
if ((int)value > (int)map[key])
|
||||
if (!map.TryGetValue(key, out object current) || (int)value > (int)current)
|
||||
{
|
||||
result.Add(key);
|
||||
}
|
||||
|
||||
@@ -13,11 +13,6 @@ namespace Snap.Hutao.Web;
|
||||
[SuppressMessage("", "SA1124")]
|
||||
internal static class HutaoEndpoints
|
||||
{
|
||||
/// <summary>
|
||||
/// 胡桃资源主机名
|
||||
/// </summary>
|
||||
public const string StaticHutao = "static.hut.ao";
|
||||
|
||||
#region Hutao as a Service
|
||||
public static string Announcement(string locale)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user