- Create ProfileWorker namespace with 4 separate components - ProfileWorker.cs: BackgroundService orchestrator with IOptions support - ProfileWorkerOptions.cs: Configuration model with validation - ProfileCache.cs: Thread-safe cache using composition pattern - DependencyInjection.cs: Service registration with IValidateOptions Benefits: - Separation of concerns (orchestration, config, state, DI) - IOptions pattern for appsettings.json configuration - Startup validation for configuration errors - Better testability and maintainability
16 lines
427 B
C#
16 lines
427 B
C#
namespace ECMJobRunner.WebCron.ProfileWorker;
|
|
|
|
/// <summary>
|
|
/// Configuration options for ProfileWorker background service.
|
|
/// </summary>
|
|
public class ProfileWorkerOptions
|
|
{
|
|
public const string SectionName = "ProfileWorker";
|
|
|
|
/// <summary>
|
|
/// Interval in milliseconds between profile synchronization checks.
|
|
/// Default: 1000ms (1 second)
|
|
/// </summary>
|
|
public int IntervalMS { get; set; } = 1000;
|
|
}
|