adds the ability for shards to sync with the main server regarding their caches, when pulling files from main server the shard can stream it to the client directly while downloading and add info for server to report to client regarding file locations across shards

This commit is contained in:
Abelfreyja
2026-01-14 16:52:06 +09:00
parent e8c56bb3bc
commit 0eea339e41
11 changed files with 915 additions and 27 deletions

View File

@@ -97,6 +97,7 @@ public class Startup
// specific services
if (_isMain)
{
services.AddSingleton<IShardFileInventoryReporter, NullShardFileInventoryReporter>();
services.AddSingleton<IClientReadyMessageService, MainClientReadyMessageService>();
services.AddHostedService<MainFileCleanupService>();
services.AddSingleton<IConfigurationService<StaticFilesServerConfiguration>, LightlessConfigurationServiceServer<StaticFilesServerConfiguration>>();
@@ -184,6 +185,9 @@ public class Startup
}
else
{
services.AddSingleton<ShardFileInventoryReporter>();
services.AddSingleton<IShardFileInventoryReporter>(sp => sp.GetRequiredService<ShardFileInventoryReporter>());
services.AddHostedService(sp => sp.GetRequiredService<ShardFileInventoryReporter>());
services.AddSingleton<ShardRegistrationService>();
services.AddHostedService(s => s.GetRequiredService<ShardRegistrationService>());
services.AddSingleton<IClientReadyMessageService, ShardClientReadyMessageService>();