You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example for "Asynchronous timed background task" calls DoWork() which blocks before the ExecuteAsync method becomes asynchronous, which goes against the own advice on this page:
No further services are started until ExecuteAsync becomes asynchronous, such as by calling await. Avoid performing long, blocking initialization work in ExecuteAsync. The host blocks in StopAsync(CancellationToken) waiting for ExecuteAsync to complete.
Description
The example for "Asynchronous timed background task" calls
DoWork()
which blocks before theExecuteAsync
method becomes asynchronous, which goes against the own advice on this page:Page URL
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-9.0&tabs=visual-studio
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/host/hosted-services.md
Document ID
b2dece1f-15b8-03af-6d52-7cc070432b4b
Article author
@tdykstra
Metadata
Related Issues
The text was updated successfully, but these errors were encountered: