public Task StartAsync(CancellationToken cancellationToken) { _logger.LogInformation("Start task."); #if false IApplicationLifetime.ApplicationStarted sets _healthCheck.StartupTaskCompleted to true // Simulate the effect of a long-running startup task. Task.Run(async() => { await Task.Delay(_delaySeconds * 1000); _healthCheck.StartupTaskCompleted = true; _logger.LogInformation($"Startup Background Service has started."); }); #endif return(Task.CompletedTask); }