Merge pull request #5196 from sbwalker/dev

fix #5193 - prevent scheduled jobs from blocking startup
This commit is contained in:
Shaun Walker 2025-03-25 19:07:24 -04:00 committed by GitHub
commit f2559b7d4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,6 +46,8 @@ namespace Oqtane.Infrastructure
protected async Task ExecuteAsync(CancellationToken stoppingToken) protected async Task ExecuteAsync(CancellationToken stoppingToken)
{ {
await Task.Yield(); // required so that this method does not block startup
while (!stoppingToken.IsCancellationRequested) while (!stoppingToken.IsCancellationRequested)
{ {
using (var scope = _serviceScopeFactory.CreateScope()) using (var scope = _serviceScopeFactory.CreateScope())