mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-21 12:21:14 +00:00
[AZ-312] [AZ-313] [AZ-314] Split Services into per-component csprojs
Phase B of architecture coupling refactor (epic AZ-309). Replaces the monolithic SatelliteProvider.Services with three per-component csprojs to add a compiler-enforced module boundary (resolves F4): - SatelliteProvider.Services.TileDownloader - SatelliteProvider.Services.RegionProcessing - SatelliteProvider.Services.RouteManagement DI registrations relocated into per-component AddTileDownloader / AddRegionProcessing / AddRouteManagement extension methods called from Program.cs. RateLimitException moved to Common/Exceptions/ to keep the three new csprojs as siblings (no Region->TileDownloader ProjectReference). Dockerfiles and consumer csprojs (Api, Tests) rewired to the new project paths. No DI lifetime or hosted-service order changes. Build: 0 warn, 0 err. Unit tests: 40/40. Smoke integration: green. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using SatelliteProvider.Common.Configs;
|
||||
using SatelliteProvider.Common.Interfaces;
|
||||
|
||||
namespace SatelliteProvider.Services.RegionProcessing;
|
||||
|
||||
public static class RegionProcessingServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddRegionProcessing(this IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<IRegionRequestQueue>(sp =>
|
||||
{
|
||||
var processingConfig = sp.GetRequiredService<IOptions<ProcessingConfig>>().Value;
|
||||
var logger = sp.GetRequiredService<ILogger<RegionRequestQueue>>();
|
||||
return new RegionRequestQueue(processingConfig.QueueCapacity, logger);
|
||||
});
|
||||
services.AddSingleton<IRegionService, RegionService>();
|
||||
services.AddHostedService<RegionProcessingService>();
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user