Can't figure out how to implement StartupTask
This commit is contained in:
parent
e60d84a2c8
commit
4c6758b9b0
2 changed files with 4 additions and 10 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue