let file shards register against main or so

This commit is contained in:
Stanley Dimant
2024-11-16 23:02:04 +01:00
parent 532c123927
commit 3a9f93b157
12 changed files with 457 additions and 48 deletions

View File

@@ -1,13 +0,0 @@
namespace MareSynchronosShared.Utils.Configuration;
public class CdnShardConfiguration
{
public List<string> Continents { get; set; }
public string FileMatch { get; set; }
public Uri CdnFullUrl { get; set; }
public override string ToString()
{
return CdnFullUrl.ToString() + "[" + string.Join(',', Continents) + "] == " + FileMatch;
}
}

View File

@@ -0,0 +1,8 @@
namespace MareSynchronosShared.Utils.Configuration;
public class ShardConfiguration
{
public List<string> Continents { get; set; }
public string FileMatch { get; set; }
public Dictionary<string, Uri> RegionUris { get; set; }
}

View File

@@ -1,5 +1,4 @@
using MareSynchronosShared.Utils;
using System.Text;
using System.Text;
namespace MareSynchronosShared.Utils.Configuration;
@@ -25,8 +24,7 @@ public class StaticFilesServerConfiguration : MareConfigurationBase
public double SpeedTestHoursRateLimit { get; set; } = 0.5;
[RemoteConfiguration]
public Uri CdnFullUrl { get; set; } = null;
[RemoteConfiguration]
public List<CdnShardConfiguration> CdnShardConfiguration { get; set; } = new();
public ShardConfiguration? ShardConfiguration { get; set; } = null;
public override string ToString()
{
StringBuilder sb = new();
@@ -42,7 +40,6 @@ public class StaticFilesServerConfiguration : MareConfigurationBase
sb.AppendLine($"{nameof(CacheDirectory)} => {CacheDirectory}");
sb.AppendLine($"{nameof(DownloadQueueSize)} => {DownloadQueueSize}");
sb.AppendLine($"{nameof(DownloadQueueReleaseSeconds)} => {DownloadQueueReleaseSeconds}");
sb.AppendLine($"{nameof(CdnShardConfiguration)} => {string.Join(", ", CdnShardConfiguration)}");
return sb.ToString();
}
}