perf(server): skip IdleTrackingBackgroundService timer in stateless mode (#1531)

This commit is contained in:
Mukunda Rao Katta 2026-06-05 18:24:34 -05:00 • committed by GitHub
commit a4157f310f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,6 +31,17 @@ internal sealed partial class IdleTrackingBackgroundService : BackgroundService
_logger = logger;
}
public override Task StartAsync(CancellationToken cancellationToken)
{
// In stateless mode there are no sessions to track, so skip starting the periodic timer entirely.
if (_options.Value.Stateless)
{
return Task.CompletedTask;
}
return base.StartAsync(cancellationToken);
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
try