sprints and audit work

This commit is contained in:
StellaOps Bot
2026-01-07 09:36:16 +02:00
parent 05833e0af2
commit ab364c6032
377 changed files with 64534 additions and 1627 deletions

View File

@@ -19,6 +19,7 @@ public sealed class CacheWarmupHostedService : BackgroundService
private readonly IAdvisoryCacheService _cacheService;
private readonly ConcelierCacheOptions _options;
private readonly ILogger<CacheWarmupHostedService>? _logger;
private readonly Func<double> _jitterSource;
/// <summary>
/// Initializes a new instance of <see cref="CacheWarmupHostedService"/>.
@@ -26,11 +27,13 @@ public sealed class CacheWarmupHostedService : BackgroundService
public CacheWarmupHostedService(
IAdvisoryCacheService cacheService,
IOptions<ConcelierCacheOptions> options,
ILogger<CacheWarmupHostedService>? logger = null)
ILogger<CacheWarmupHostedService>? logger = null,
Func<double>? jitterSource = null)
{
_cacheService = cacheService;
_options = options.Value;
_logger = logger;
_jitterSource = jitterSource ?? Random.Shared.NextDouble;
}
/// <inheritdoc />
@@ -66,7 +69,7 @@ public sealed class CacheWarmupHostedService : BackgroundService
}
}
private static TimeSpan ResolveWarmupDelay(ConcelierCacheOptions options)
private TimeSpan ResolveWarmupDelay(ConcelierCacheOptions options)
{
var delay = options.WarmupDelay;
var jitter = options.WarmupDelayJitter;
@@ -76,7 +79,7 @@ public sealed class CacheWarmupHostedService : BackgroundService
return delay;
}
var jitterMillis = Random.Shared.NextDouble() * jitter.TotalMilliseconds;
var jitterMillis = _jitterSource() * jitter.TotalMilliseconds;
return delay + TimeSpan.FromMilliseconds(jitterMillis);
}
}