Can't figure out how to implement StartupTask

This commit is contained in:
Joseph Milazzo 2021-03-17 17:21:59 -05:00
parent e60d84a2c8
commit 4c6758b9b0
2 changed files with 4 additions and 10 deletions

View file

@ -43,10 +43,8 @@ namespace API
logger.LogError(ex, "An error occurred during migration");
}
// Load all tasks from DI (TODO: This is not working - WarmupServicesStartupTask is Null)
// Load all tasks from DI and initialize them (TODO: This is not working - WarmupServicesStartupTask is Null)
var startupTasks = host.Services.GetServices<WarmupServicesStartupTask>();
// Execute all the tasks
foreach (var startupTask in startupTasks)
{
await startupTask.ExecuteAsync();