From 1ee92a248efdd5f172aad61d9f38f7b9e6325f39 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Tue, 25 Mar 2025 19:07:01 -0400 Subject: [PATCH] fix #5193 - prevent scheduled jobs from blocking startup --- Oqtane.Server/Infrastructure/Jobs/HostedServiceBase.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Oqtane.Server/Infrastructure/Jobs/HostedServiceBase.cs b/Oqtane.Server/Infrastructure/Jobs/HostedServiceBase.cs index 5c8fc04f..7f7f440a 100644 --- a/Oqtane.Server/Infrastructure/Jobs/HostedServiceBase.cs +++ b/Oqtane.Server/Infrastructure/Jobs/HostedServiceBase.cs @@ -46,6 +46,8 @@ namespace Oqtane.Infrastructure protected async Task ExecuteAsync(CancellationToken stoppingToken) { + await Task.Yield(); // required so that this method does not block startup + while (!stoppingToken.IsCancellationRequested) { using (var scope = _serviceScopeFactory.CreateScope())