perf(server): skip IdleTrackingBackgroundService timer in stateless mode (#1531)
This commit is contained in:
parent
ed19286a08
commit
a4157f310f
1 changed files with 61 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue