add speedtest stuff or so

This commit is contained in:
Stanley Dimant
2024-11-11 12:45:52 +01:00
parent 0efd94d781
commit 2f4aa1b396
5 changed files with 84 additions and 4 deletions

View File

@@ -186,6 +186,8 @@ public class Startup
services.AddHostedService(p => (MareConfigurationServiceClient<StaticFilesServerConfiguration>)p.GetService<IConfigurationService<StaticFilesServerConfiguration>>());
}
services.AddMemoryCache();
// controller setup
services.AddControllers().ConfigureApplicationPartManager(a =>
{
@@ -194,15 +196,15 @@ public class Startup
{
a.FeatureProviders.Add(new AllowedControllersFeatureProvider(typeof(MareStaticFilesServerConfigurationController),
typeof(CacheController), typeof(RequestController), typeof(ServerFilesController),
typeof(DistributionController), typeof(MainController)));
typeof(DistributionController), typeof(MainController), typeof(SpeedTestController)));
}
else if (_isDistributionNode)
{
a.FeatureProviders.Add(new AllowedControllersFeatureProvider(typeof(CacheController), typeof(RequestController), typeof(DistributionController)));
a.FeatureProviders.Add(new AllowedControllersFeatureProvider(typeof(CacheController), typeof(RequestController), typeof(DistributionController), typeof(SpeedTestController)));
}
else
{
a.FeatureProviders.Add(new AllowedControllersFeatureProvider(typeof(CacheController), typeof(RequestController)));
a.FeatureProviders.Add(new AllowedControllersFeatureProvider(typeof(CacheController), typeof(RequestController), typeof(SpeedTestController)));
}
});