Merge pull request #5196 from sbwalker/dev
fix #5193 - prevent scheduled jobs from blocking startup
This commit is contained in:
commit
f2559b7d4d
@ -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())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user